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.
Syncfusion Feedback

Multi-Row selection in GGC

Thread ID:





36826 Nov 10,2005 03:49 PM UTC Nov 14,2005 07:42 PM UTC Windows Forms 5
Tags: GridControl
Asked On November 10, 2005 03:49 PM UTC

I''m sure this has been addressed elsewhere, but there are 278 pages of posts in this forum, and I don''t have time to search through them manually. The search engine has been of little help, and the documentation is very vague on how this should work. I''ve tried various combinations of TableOptions.AllowSelection and TableOptions.ListBoxSelectionMode without success. I want to allow users to select multiple rows (so they can delete them) at both the top level and in nested levels of a GGC. What property needs to be set, and how do users select mutiple rows (click-drag, Ctrl-click, shift-click or what?) Thanks, Van Baker

Administrator [Syncfusion]
Replied On November 10, 2005 06:14 PM UTC

Try setting: this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiSelect;

Administrator [Syncfusion]
Replied On November 13, 2005 03:01 PM UTC

I tried your suggestion before posting the question and it allows multiple selection for the nested tables but does not for the top-level table (only a single selection can be made in the top level table.) However, I tried this on a _different_ GGC grid in the application and it does seem to work! I compared properties of the two grids, and the only differences seem to be the datasources. Is it possible that multiple selection, at least for the top level, is somehow coupled to other properties, or dependent on the datasource in ways that we have not discussed? BTW, I used the design-time settings to specify the selection properties, in case this matters. --Van Baker

Administrator [Syncfusion]
Replied On November 13, 2005 04:32 PM UTC

Haven''t heard of this behavior before. You might just check the settings of these properties at some place in your runtime code to make sure they are set as you expect. Are you handling any events like table.SelectedRecords.Changing/Changed? These could affect this behavior. Are you doing anything special to draw the selections, like handling TableControlPrepareViewStyleInfo?

Administrator [Syncfusion]
Replied On November 14, 2005 07:21 PM UTC

Clay, As usual, you''ve come through with the answer! When you stated that you''d not heard of this behavior before, I decided it HAD to be something in my code that was causing the problem. I followed your advice and carefully inspected my runtime code. In the form Load event handler, I finally noticed the following lines: this.gridGroupingControl1.DataSource = this.dataSet; this.gridGroupingControl1.TableDescriptor.TableOptions.ListBoxSelectionMode = SelectionMode.One; The first line is fine, but the line hiding beneath it was causing the problem. When I removced it, multi-selection of the top-level rows worked as desired. But I do have a question: Can you explain the difference between the TableOption properties and TableDescriptor.TableOption properties? Also, can you clarify what the AllowSelection and ListBoxSelectionMode properties actually do? Thanks, Van Baker

Administrator [Syncfusion]
Replied On November 14, 2005 07:42 PM UTC

The properties set using this.gridGroupingControl1.TableOptions, are used to initialize all the TablesOptions for all the nested tables which you can get at using TableDescriptor.TableOptions. So, you were resetting the ListBoxSelectionMode for the particular table. AllowSelections and ListBoxSelectionMode behaviors are initially defined for the GridControlBase class. By setting various flags in AllowSelections, you control the selection behavior of our grids, GridControl and GridDataBoundGrid. GridGroupingControl.TableControl does inherit from GridControlBase, so you can use the flags in TableControl.AllowSelections to try affect selections. But this inherited selection support does not take into account the nature of the GridGroupingControl (nested tables and groups). So, there is special selection architecture available in GridGorupingControl. You turn on this special GridGroupingControl selection support by setting the two properties I mentioned above.


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.

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