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

GridGroupingControl and AllowSelection

Thread ID:

Created:

Updated:

Platform:

Replies:

21964 Nov 30,2004 05:40 AM Nov 30,2004 08:47 AM Windows Forms 1
loading
Tags: Grouping
Jaris
Asked On November 30, 2004 05:40 AM

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 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

CONFIRMATION

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.

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.

;