We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Hide expandable group header

Hi,

I'm grouping the data like the documentation says:

           <Syncfusion:SfDataGrid.GroupColumnDescriptions >
                <Syncfusion:GroupColumnDescription ColumnName="MyRowId"  />
            </Syncfusion:SfDataGrid.GroupColumnDescriptions>

It's working fine but it's not completely what I'm looking for.

This piece of code makes the view of the datagrid richer with an expandable row which can be clicked to show the grouped data (or AutoExpandGroups on control).

Is there a way to hide the expandable group row? So it is always automatically expanded and that this expandable row is not visible?

Thanks!

1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team September 14, 2017 05:58 PM UTC

Hi Erik, 

Thank you for contacting Syncfusion support. 

You can able to hide the expander row(Caption Summary Row) by handling the QueryRowHeight event of SfDataGrid as like the below codes. 

Code Snippet

this.sfGrid.QueryRowHeight += SfGrid_QueryRowHeight; 
 
private void SfGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) 
{ 
    var groupRow = (sfGrid.RowGenerator.Items.FirstOrDefault(x => x.RowIndex == e.RowIndex && (x.RowType == RowType.SummaryRow || x.RowType == RowType.SummaryCoveredRow 
    || x.RowType == RowType.CaptionCoveredRow || x.RowType == RowType.CaptionRow))); 
    if (groupRow != null) 
    { 
        e.Height = 0; 
        e.Handled = true; 
    } 
} 



If your requirement is different from this, could you please share some more information about your requirement clearly ?.  This would be more helpful for us to proceed further.   
 
Regards, 
Muthukumar K 


Loader.
Up arrow icon