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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bug in GridDataBound

Thread ID:





11602 Mar 11,2004 08:03 AM UTC Mar 11,2004 08:31 AM UTC WinForms 1
Tags: GridControl
Samuel Jack
Asked On March 11, 2004 08:03 AM UTC

I have discovered a bug with selections in GridDataBoundGrid. To replicate this bug try the following steps: create a GridDataBoundGrid and ensure that it has some data in it whilst holding down Ctrl, select a single cell still holding Ctrl, select another other single cell still holding Ctrl, select the first cell again still holding Ctrl select the second cell again repeat as often as you like Now look at _grid.Selections.Ranges.Info property. You will see that rather than each cell being added only once, they are each present multiple times. If you need more info, just ask. Sam

Administrator [Syncfusion]
Replied On March 11, 2004 08:31 AM UTC

Pressing control will allow you to add the sane range twice. This is by design. (Without this, it would be difficult to add two different ranges that intersect using the control key). If you do not want this behavior, then you can handle the SelectionChanging event (Model.SelectionChanging in GridDataBoundGrid), and cance the selection if it is a control-click into a selected cell.
private void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
	bool ctl = (Control.ModifierKeys & Keys.Control) != 0;
	if(ctl && e.Range.Height == 1 && e.Range.Width == 1)
		if(this.gridControl1.Selections.Ranges.IndexOf(e.Range) > -1)
			e.Cancel = true;


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

Live Chat Icon For mobile
Live Chat Icon