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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Different Selection Modes in a nested table

Thread ID:





46809 Jul 21,2006 01:32 AM UTC Jul 21,2006 03:54 PM UTC WinForms 1
Tags: GridControl
Bill Langlais
Asked On July 21, 2006 01:32 AM UTC

I have a five level nested table. I want the top three levels to only allow one row to be selected. I want the fourth level to allow multiple selections unless you select a row at the fifth level. If you select a row at the fifth level then I want the fourth level to only allow the related row to be selected. Ideally the parrent rows for any child select row would always be selected.

My question is can this be acheived through table options or do I have to trap the selection events and manually select and deselect to acheive the behaviour?

Administrator [Syncfusion]
Replied On July 21, 2006 03:54 PM UTC

Hi Bill,

One way to achieve this behavior is to handle the Model.SelectionChanging event of the corresponding TableControl. Set the ListBoxSelectionMode to MultiExtended for the gridgroupingcontrol. Below is the code snippet.

this.gridGroupingControl1.GetTableControl("MyChildTable").Model.SelectionChanging += new Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventHandler(Model_SelectionChanging_MyChildTable);

In this event handler, you can check for the e.Reason and cancel it when it is MouseMove, so that more than one row can not be selected.

// Form_Load
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;

private void Model_SelectionChanging_MyChildTable(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs e)
if(e.Reason == GridSelectionReason.MouseMove)
e.Cancel = true;

Please try this and let me know if this helps.


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