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.

Different Selection Modes in a nested table

Thread ID:

Created:

Updated:

Platform:

Replies:

46809 Jul 20,2006 09:32 PM Jul 21,2006 11:54 AM Windows Forms 1
loading
Tags: GridControl
Bill Langlais
Asked On July 20, 2006 09:32 PM

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 11:54 AM

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.
Regards,
Rajagopal

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.

;