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

Bug in GridDataBound 2.0.2.1

Thread ID:

Created:

Updated:

Platform:

Replies:

11602 Mar 11,2004 08:03 AM UTC Mar 11,2004 08:31 AM UTC Windows Forms 1
loading
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;
	}
}

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.

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

;