Hi Huzefa,
Thanks for contacting Syncfusion support.
We have prepared sample for your requirement by using GroupColumnDescription.Converter in SfDataGrid. In that sample we have grouped based on Initial letter of CustomerName column.
Please refer the below code example.
GroupColumnDescriptions.Add(new GroupColumnDescription()
{
ColumnName = "Freight",
Converter = new GroupConverter()
});
……..
public class GroupConverter : IValueConverter
{
public GroupConverter()
{
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var orderInfo = value as OrderInfo;
var name = orderInfo.FirstName;
var firstLetter = name.First().ToString();
return firstLetter;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
} |
We hope this helps, please let us know if need further assistance from us.
Regards,
Karthik Raja