I'm using a derived class of gridDataBoundGrid in multiselection rows mode.
I'm overriding OnRowEnter method.
When I'm selecting a row with the mouse I get in the Selections property the right row. When I'm moving the selection with the key up / down arrows the Selection property is empty.
When I'm selecting multirows with the mouse the Selection property has all the rows. If I do the selection with the keyboard I get in the Selection property the rows that were selected before the keyboard event and not the new rows.
Is this a bug ? Is there another method I can override that has the same values for Selection for mouse events and for keyboard events ?
when I was registering to grid.model.SelectionChanged I got the event more than once for each selection ?
The Model.SelectionChanged event is raising at least twice, because of the deselect of the old row and the select of the new row. Im using this event to build an internal list of the selected DataRows and it works for me.
ADAdministrator Syncfusion Team October 1, 2003 09:50 AM
there are some internal differences the way selections are added/removed between keyboard and mouse action. But you should have all the information you need be provided by the SeclectionChangeXXX events. Make sure you do also check the GridSelectionReason of the event to handle the different scenarios that caused the event to be raised.
ASAsaf SegalOctober 1, 2003 08:39 PM
So when should I use RowEnter ?
ASAsaf SegalOctober 2, 2003 01:48 AM
I checked the reason property of the selection changed event.
This event occurs number of time and not the same number in different situations.
Is there a way to know what is the last selection changed event ? ( I draw the selected objects in the grid and I get flickering because of the selection changed events that happend before the last one in each selection )
I had an idea of catching the mouse up and key up events, then I figured that I need also the mouse move event. I didn't find a way to get the "last change" when the arrow keys are pressed continuesly so there is no key up event until the end of the selection
ADAdministrator Syncfusion Team October 3, 2003 10:41 AM
You could cache the eventargs of the last SelectionChanging or SelectionChanged event in a field in your class and then check that field in the next SelectionChanging event.
Does that help?
ASAsaf SegalOctober 6, 2003 09:49 PM
Sorry, but it doesn't.
I need to know of a new selection that came from the mouse or from the keyboard, and I don't want to get more event than I need.
My applications draws objects in a window, according to lines that are selected in the grid.
I don't care which event or events I should catch but I want to know that the selection operation has finished so I can redraw the window.
I want the window and the grid to be syncronized so if the user is draging the mouse on the grid, or continuesly pressing down key, operations that makes the selection graw, without key up / mouse up events, I still want to know that I should redraw the window.
ADAdministrator Syncfusion Team October 7, 2003 05:53 AM
If you create a sample application and add comments that explain in which scenarios the eventargs (please give instructions how to reproduce) passed to SelectionChanging are not detailed enough I'll take a look and debug into it.