Hi,
I have a control derived from GridControl. I have set the ListBoxSelectionMode to
MultiSimple. I have some issues here:
- I am not able to select the rows using arrow keys and also by clicking and dragging the mouse holding the shift key.
- I have custom property to set the color of the selected row. I am setting this color in OnPreviewViewStyleInfo ovverride method. But this has no effect and the selection color is something othet than what I set.
PFA sample illustrating the issues. I am setting the Selection Color to Info where as it is displaying in some other color.
Essential Studio version: 4.4.0.51
I need to urgently fix these issues. Your help will be highly appreciated. Thanks.
Regards
Kiran
HA
haneefm
Syncfusion Team
November 19, 2007 10:53 PM UTC
Hi Kiran,
Issue1:
To extend the selection when the ArrowKey is pressed,you need to handle the CurrentCellKeyDown event of the grid and call MoveDown/MoveUp method. Here are the codes:
private void gridControl1_CurrentCellKeyDown(object sender, KeyEventArgs e)
{
if (this.gridControl1.ListBoxSelectionMode == SelectionMode.MultiSimple )
{
if( e.KeyCode == Keys.Down )
gridControl1.CurrentCell.MoveDown(1, true);
else
gridControl1.CurrentCell.MoveUp(1, true);
e.Handled = true;
}
}
Issue2:
You can use AlphaBlendSelectionColor property to change the selected row''s color. Please refer to the following code snippet.
[C#]
this.gridDataBoundGrid1.AlphaBlendSelectionColor = Color.Green;
Best regards,
Haneef
KR
Kiran Reddy
November 20, 2007 10:28 AM UTC
Hi Haneef,
Can you modify the attached sample (in my previous mail)? I am not able to resolve issues with the changes you suggested. Thanks.
Regards
Kiran
HA
haneefm
Syncfusion Team
November 20, 2007 03:40 PM UTC
Hi Kiran,
Please refer to the attached sample for implementation and let me know if this helps.
GridRowSelection.zipBest regards,
Haneef
KR
Kiran Reddy
November 21, 2007 03:32 PM UTC
Hi Hannef,
I am able to set the selected color. But not selction using arrows. I have overriden the method OnCurrentCellKeyDown, but the method is not getting called at all.
Please let me know how to resolve this. Thanks.
Regards
Kiran
KR
Kiran Reddy
November 21, 2007 03:32 PM UTC
Hi Hannef,
I am able to set the selected color. But not selction using arrows. I have overriden the method OnCurrentCellKeyDown, but the method is not getting called at all.
Please let me know how to resolve this. Thanks.
Regards
Kiran
KR
Kiran Reddy
November 22, 2007 11:33 AM UTC
Hi,
Setting ListBoxSelectionMode to MultExtended doesn't give the intended functionality. The functionality I am looking for is:
- Click on an item, select that row. Clear all other selections.
- Shift + Click, select all the clicked items.
- Control + Click, select multiple ranges.
Kindly let me know how do I achieve this. Probably a smaple would help. Thanks.
Regards
Kiran
HA
haneefm
Syncfusion Team
November 30, 2007 10:56 PM UTC
Hi Kiran,
I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in browser sample with Essentail studio V.4.x/5.x. But i was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the browser sample to reproduce the issue here? This will help us to analyse the issue further.
Best regards,
Haneef