Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:18:26+00:00 2026-05-24T21:18:26+00:00

I am grouping datagrid upto one sub-level. Like this: CollectionViewSource pageView = new CollectionViewSource();

  • 0

I am grouping datagrid upto one sub-level.

Like this:

      CollectionViewSource pageView = new CollectionViewSource();
      pageView.GroupDescriptions.Add(new PropertyGroupDescription("Category"));
      pageView.GroupDescriptions.Add(new PropertyGroupDescription("SubCategory"));
      tasksDataGrid.ItemsSource = pageView.View;

In my case some records doesn’t have Subcategory value.Those records will display under empty row group header of Subcategory in datagrid.

I would like to display directly under Category row group header instead of empty header.

 private void TaskDataGrid_LoadingRowGroup(object sender, DataGridRowGroupHeaderEventArgs e)
    {
        string RowGroupHeader  = // how to get currently loading header value
        if(RowGroupHeader == string.Empty)
        {
          e.RowGroupHeader.Height = 0;
        }
    }

I can’t get currently loading RowGroupHeader value.How can i get RowGroupHeader value in LoadingRowGroup event.

Help me on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:18:27+00:00Added an answer on May 24, 2026 at 9:18 pm

    This solved the problem.

    private void TaskDataGrid_LoadingRowGroup(object sender, DataGridRowGroupHeaderEventArgs e)
    {
    
         var RowGroupHeader = (e.RowGroupHeader.DataContext as CollectionViewGroup);
    
                    if (RowGroupHeader != null && RowGroupHeader.Items.Count != 0)
                    {
    
                            MasterTask task = RowGroupHeader.Items[0] as MasterTask;
                            if (task != null && task.SubCategoryName == null)
                                e.RowGroupHeader.Height = 0;
    
    
                   }
     }
    

    Thanks djohnsonm for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Grouping WHERE clauses with Zend_Db_Table_Abstract I need to create something like this:
I am wondering how should I be grouping my repositories? Like from the examples
I've got an ArrayCollection which is properly displayed in this Advanced Datagrid: <mx:AdvancedDataGrid id=drawingDataDG
is there a good way of grouping content up by category. I wish I
I want to add a header row grouping the column headers. Departure Arrival <--
Does anybody know a free datagrid or listview control with grouping and master/detail capabilites?
I was trying to implement Grouping and paging in silverlight 3's datagrid, I found
I have an advanced datagrid, with the grouping collection attached to an XMLListCollection. I
I am using the PagedCollectionView for grouping. I have a DataGrid and a textbox
I have a dual level grouping and thought I could define different styles with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.