Articles in this section
Category / Section

How to create the single group for null and empty value in Windows Forms DataGrid(SfDataGrid)?

1 min read

By default, empty and null values are created the separate groups in SfDataGrid. You can able to create the single group for empty and null value by using KeySelector in GroupColumnDescription.

 

this.sfDataGrid.GroupColumnDescriptions.Add(new GroupColumnDescription()
{
    ColumnName = "Country",
    KeySelector = (string ColumnName, object o) =>
    {
        var item = (o as OrderInfo).Country;
        if (item == null || item == "")
        {
            return "";
        }
 
        return item;
    }
});

 

SfDataGrid Grouping

 

View sample in GitHub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied