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.

Mutliselect datagrid

Thread ID:





58796 Mar 28,2007 11:28 AM Mar 28,2007 03:08 PM Windows Forms 1
Tags: GridControl
Todd Swygert
Asked On March 28, 2007 11:28 AM

I have a GridDataBoundGrid that I'm trying to use as a multiselect control. Users will select several rows and then perform an action based on the selections. When focus leaves the grid, all the selections are removed and focus is put on the first row. How do I prevent my selections from clearing when leaving the grid?


haneefm [Syncfusion]
Replied On March 28, 2007 03:08 PM

Hi Todd,

One way you can do this by handling the Model.Selectionchanging event of the grid and set e.Cancel to true for keeping the selection in a grid. Here is a code snippet.

this.grid.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
e.Cancel = !this.grid.Focused;

Best regards,


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.