Grouping Error with Custom Binding

Hi everibody,

  I built a simple grid with custom binding according to your documentation. Trying to group a column produces an error (see attached sample). I am using Win 10 prof Ver. 1909 in German VS Community 16.5.5 and Syncfusion 18.1.0.52.
Your grid sample produced by template editor with similar data (no custom binding) is working OK.

  regards

    Uwe

Attachment: GridGroupingError_d12e47fe.zip

3 Replies

RS Renjith Singh Rajendran Syncfusion Team May 18, 2020 12:32 PM UTC

Hi Uwe, 

Greetings from Syncfusion support. 

We have discussed about this topic in the below thread. So, we suggest you to refer the below thread for more details regarding this topic. 

As discussed in above link, we suggests you to handle the Grouping action in Grid as like the below code to overcome the problem you are facing. The below solution is discussed in the updates of the above thread. 

 
                     public override object Read(DataManagerRequest dm, string key = null)                  
                      { 
                             System.Diagnostics.Debug.WriteLine("ReadAsync"); 
 
                             IEnumerable<Order> DataSource = Orders; 
                             DataResult DataObject = new DataResult(); 
                             ... 
                             if (dm.Group != null) 
                             { 
                                    IEnumerable ResultData = Enumerable.Empty<Order>(); 
 
                                    foreach (var group in dm.Group) 
                                    { 
                                           ResultData = DataUtil.Group<Order>(DataSource, group, dm.Aggregates, 0, dm.GroupByFormatter); 
                                    } 
                                    DataObject.Result = ResultData; 
                                    DataObject.Count = count; 
                                    return dm.RequiresCounts ? DataObject : (object)ResultData; 
                             } 
                             return dm.RequiresCounts ? new DataResult() { Result = DataSource, Count = count } : (object)DataSource; 
                      } 


Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 



UH Uwe Hein May 18, 2020 02:28 PM UTC

Hi Renjith,

   sorry for not looking deep enough in the threads.

Problem solved.

Maybe you should mention this in your documentation, because I got the source code from there.

   Thank you

       regards

          Uwe


RN Rahul Narayanasamy Syncfusion Team May 19, 2020 06:59 AM UTC

Hi Uwe, 

Thanks for the update. 

We have logged a documentation task for this and this will be included in any of our upcoming release. 

Regards, 
Rahul 


Loader.
Up arrow icon