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

How to group by First Initial of a particular column value rather than the whole column value?

4 Replies

KK Karthikraja Kalaimani Syncfusion Team October 17, 2019 02:03 PM UTC

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.

Karthik Raja

HU Huzefa November 12, 2019 12:53 AM UTC

HU Huzefa November 12, 2019 12:54 AM UTC

Thanks Karthink.

FP Farjana Parveen Ayubb Syncfusion Team November 12, 2019 09:50 AM UTC

Hi Huzefa 
Thanks for the update. 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
Farjana Parveen A 

Live Chat Icon For mobile
Up arrow icon