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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl and AllowSelection

Thread ID:





21964 Nov 30,2004 10:40 AM UTC Nov 30,2004 01:47 PM UTC WinForms 1
Tags: Grouping
Asked On November 30, 2004 10:40 AM UTC

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 ?

Administrator [Syncfusion]
Replied On November 30, 2004 01:47 PM UTC

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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon