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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

incorrectly selecting a range of rows from the grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

52096 Nov 21,2006 07:25 PM UTC Jan 17,2007 11:01 PM UTC WinForms 2
loading
Tags: GridControl
Matthew Bates
Asked On November 21, 2006 07:25 PM UTC

Some issues with selecting rows from the grid:

Shift+click incorrectly toggles the seletion of a row if there were previous rows selected by Ctrl+click, and the last one of those rows has be selected then de-selected using Ctrl+click.

1. Select some rows using Ctrl+click.
2. Deselect the final row in the range, also using Ctrl+click.
3. Shift+click to select a range of rows beyond the row deselected.
- The last ctrl-selected row (in the oposite direction from the shift-select) has it's state toggled.

Example of above steps:
1. ex: ctrl-select rows 3,4,7.
2. ex: ctrl-deselect row 7.
3. ex: hold Shift and click row 10, selecting rows 7-10.
- row 4 incorrectly changes from selected to unselected!?


...this unwanted behavior also works in the other direction, except that it selects a row that was previously unselected. Examples of several cases:
example A:
1. ctrl-select rows 3,4,7.
2. ctrl+deselect row 7.
3. shift-select from row 7-10.
- row 4 becomes unselected.

example B:
1. ctrl-select rows 3,4,7.
2. ctrl+deselect row 7.
3. shift-select from row 3-1.
- all rows 7-1 becomes selected (but 7,6,5 should not be).

example C:
1. ctrl-select rows 3,4,7.
2. ctrl+deselect row 3.
3. shift-select from row 7-10
- all rows 3-10 become selected (but 3 should not be).

example D:
1. ctrl-select rows 3,4,7.
2. ctrl+deselect row 3.
3. shift-select from row 3-1.
- row 3 becomes re-selected, 7 becomes unselected.

Administrator [Syncfusion]
Replied On November 22, 2006 11:31 AM UTC

Hi Matthew,

You can handle the Model.SelectionChanging event and set e.Cancel = true to select the rows programatically. Here is a code snippet to show this.

private void gridControl1_SelectionChanging(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs e)
{
if( IsShiftKeySelection )
{
e.Cancel = true;
GridControl grid = sender as GridControl;
IsShiftKeySelection =false;
grid.Model.Selections.Add(e.ClickRange);
}
}

Sample : http://www.syncfusion.com/Support/user/uploads/GC_SelectionTest_be25542.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 17, 2007 11:01 PM UTC

Thank you.

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

;