Skip to content

This example explains about how to create the single group for null and empty value in WPF DataGrid(SfDataGrid).

Notifications You must be signed in to change notification settings

SyncfusionExamples/How-to-create-the-single-group-for-null-and-empty-value-in-WPF-DataGrid-SfDataGrid-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

How to create the single group for null and empty value in WPF DataGrid SfDataGrid

About the sample

This example illustrates how to create the single group for null and empty value in WPF DataGrid (SfDataGrid).

An empty and null values are created the separate groups in WPF DataGrid (SfDataGrid). You can able to create the single group for empty and null value by using Converter in GroupColumnDescription.

dataGrid.GroupColumnDescriptions.Add(new GroupColumnDescription() { Converter = new GroupStringNullConverter(), ColumnName = "CustomerName" });


public class GroupStringNullConverter: IValueConverter
{
    public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
    {
        var customerName = value as OrderInfo;

        if (string.IsNullOrEmpty(customerName.CustomerName))
            return null;
        else
            return customerName.CustomerName;
    }

    public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture)
    {
        throw new System.NotImplementedException();
    }
}

KB article - How to create the single group for null and empty value in WPF DataGrid SfDataGrid

Requirements to run the demo

Visual Studio 2015 and above versions

About

This example explains about how to create the single group for null and empty value in WPF DataGrid(SfDataGrid).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages