Grouping problems with virtualization and Frozen columns

Hi.  I have a somewhat convoluted problem with enabling grouping, and I've had great difficulty reproducing this in a small sample app, but that app does have some issues so I'm hoping some insight into these issues might also help in my actual application.

I have a grid, and the exact format (number of columns, names/titles/data types/display format of those columns, which columns are "Frozen", etc) is NOT KNOWN at compile time.  I have managed to get the grid to work by using an object derived from `DynamicObject` as the Row type, and the "Fields" are named based on indexing so if a table column is defined as field `__F0` or similar then that is Addressed via `TryGetMember` which works out which of an array of fields is being pointed to.  

The Header of each column is calculated at runtime and injected in using the `<HeaderTemplate>` property of the Grid Column, as this can include line breaks and other bits of information.

We re-use this approach in more than one place, and because we sometimes have hundreds of rows I've found that using virtualisation helps a lot.

I have managed to get the grid to work fine, and display Totals as well, but when I try to use grouping I've found it just doesn't show any data rows at all when I'm using virtualization, and if I turn that off there's some other strange behaviour:
If my grid looks like this:
Image_5248_1702319532329And I then group by  the first column, I see the following issues:

  • first of all the dragged item an the description of the column is purely based on the `HeaderText` property, and not the `HeaderTemplate` which I've used to define the header on the grid ("Col 0" vs "This field is Col 0")
  • Secondly, the "group header" shows to the right of the Frozen columns, which then throws all the subtotals off-line
Image_5116_1702319722335
If I then cancel that grouping operation,  by clicking the "col 0" group "button", it throws an error, seemingly for every single row (100+ times in this case)
Image_8053_1702319857017

Finally, if I enable virtualisation, then I only see an entirely empty grid after grouping:Image_9589_1702319958540
The documentation suggests grouping will only work on the rows which are loaded if you have virtualization enabled, but in this case I see rows, then after grouping I see none at all.

I have attached a sample project which illustrates these things.  Just switch virtualization on/off to see the difference there, and leave it off to see the other issues.

Can these things be easily remedied?

Thanks

Giles Wakefield

Attachment: DynamicGrid2_ed7de5ec.zip

3 Replies

NP Naveen Palanivel Syncfusion Team December 13, 2023 01:03 AM UTC

Hi Giles ,


Thanks for contacting Syncfusion support.


We have analyzed your query, we suspect that column with one to many relationship. currently we don’t have support to perform DataOperations in a column with one to many relationship data (like List<object>)  in Grid column. We have considered to implement this feature “Provide data operation for one to many relationship columns” request, and added this to our feature request list. Based on specific parameters including product vision and technological feasibility we will implement this feature. This feature will be available in any of our upcoming releases. In the meantime, we suggest you to use our Complex column and foreign key column features which can be used to display values from different tables that have the same foreign key. Please refer to the attached documentation for more information


Reference: https://blazor.syncfusion.com/documentation/datagrid/column-rendering#complex-data-generation

                    https://blazor.syncfusion.com/documentation/datagrid/foreignkey-column


Feedback Link : https://www.syncfusion.com/feedback/12731/provide-data-operation-for-one-to-many-relationship-columns  


Please let us know if you have any concerns.


Regards,

Naveen Palanivel



GW Giles Wakefield December 13, 2023 12:02 PM UTC

Hi.  I'm not sure what you mean by a one-to-many relationship;  There is nothing I would regard as such in this scenario.  Each column is pointing to a single value, albeit one fetched from an object via a "property Name" which is resolved at runtime via use of a DynamicObject.  The object representing a *row* contains a list of items, and each item in the list represents a single cell.

There is no "lookup" of data required beyond simple functions which get things like headers and cell formats, and none of my questions relate directly to those functions.  For clarity my actual questions are:

  • Is it at all possible to use column grouping when Virtualization is turned on to help performance with larger datasets?
  • Why do I get a JS error when *removing* a grouping?
  • Why does the dragged/dropped "column header" text seem to only refer to the "HeaderText" property of the column and not the "HeaderTemplate" where this is defined?
  • Why when I group by a "Frozen" column does the group header info get drawn to the *right* of the frozen columns?



SP Sarveswaran Palani Syncfusion Team December 15, 2023 04:05 AM UTC

Hi Giles,

Sorry for the inconvenience caused.

Upon reviewing your query and the shared code snippet, it appears that you are attempting to perform a grouping operation within the frozen columns. Unfortunately, this functionality is not feasible to achieve as frozen rows and columns do not support this feature. We have previously mentioned this limitation in our UG documentation. Kindly refer the attached documentation link for more reference.

Reference: https://blazor.syncfusion.com/documentation/datagrid/scrolling#limitations

If you have any further queries, please get back to us.

Regards,
Sarvesh


Loader.
Up arrow icon