The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a problem with GridGroupingControl.
I have allowed „Row, Multiple, Shift“ selection in TableOptions and.
I can select more rows but I don’t know how to get collection of all selected rows in my C# code.
Can you help me ?
ADAdministrator Syncfusion Team November 30, 2004 08:47 AM
Hi Jaris,
you need to loop through the TableModel.Selections.Ranges
collection.
Each GridRangeInfo will have a Top and Bottom row which indicates the rowindex.
To get the record at that row you would then pass the row index into
Element el = Table.DisplayElements[rowIndex];
To get the actual record call
Record r = el.ParentRecord;
Please note that there are a couple of limitations to the cell-based selection mechanism in 2.x. For example, the selections are not adjusted when you collapse or expand groups.
With 3.x we have a new record based selection mechanism.
Check out the sample \Syncfusion\Essential Suite\3.0.0.x\Windows\Grid.Windows\Samples\Grouping\MultipleRecordSelection
That sample shows multiple record selection across nested tables and groups. Marked records will stay selected even if you change the sort order or grouping.
You have the option to continue to use the cell based selection mechanism compatible with 2.x or to use the record-based selection mechanism.
If you set TableOptions.AllowSelection = GridSelectionFlags.None and specify ListBoxSelectionMode then the new record based selection code will be used.
Otherwise, of If you set TableOptions.AllowSelection then the old GridModel based selection code will be used.
With the new mechanism you can interate through selected record with the Table.SelectedRecords collection.
Stefan