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

Event for capturing row selectiom

What event is best for capturing the user's selection of rows? Thanks for your help Grer

10 Replies

AD Administrator Syncfusion Team June 30, 2003 08:44 PM UTC

Try SelectionChanging or SelectionChanged.


GR grer July 1, 2003 11:48 AM UTC

OH, I'm using a gridDataboundGrid. That events is not in this grid. Could you suggest another event method for the grid databound grid. Thanks


AD Administrator Syncfusion Team July 1, 2003 08:57 PM UTC

The SelectionChanging/SelectionChanged events are members of the GridDataBoundGrid.Model class. You can get at this event from the GridDataBoundGrid.Model.SelectionChanged. In C#, you would use this.gridDataBoundGrid1.Model.SelectionChanged += ... and in VB you would use Addhandler me.gridDataBoundGrid1.Model.SelectionChanged, addressof .....


GR grer July 2, 2003 12:14 PM UTC

many thanks


GR grer July 24, 2003 08:14 AM UTC

The GDBG.Model.SelectionChanged event fires when the user selects a row in the grid but the selections.count is zero initially then the user has to select the row/cell a second time for the selections collection to have items. After the second time the grid selection works fine. Is this a bug?


AD Administrator Syncfusion Team July 24, 2003 10:38 AM UTC

This event will fire when selections are removed also. For example, if you are using ListBoxMode, then when you click another row, this event is hit twice, once to remove the original selection and once to add the new selection. You can test e.Range to distinguish these case as e.Range is empty when a selection is being removed. If this does not explain what you are seeing, can you post a little sample project showing the problem, or tell us how to see it in one of the samples we ship?


GR grer July 25, 2003 01:44 PM UTC

HEre is the code added to one of your samples. Just click on the grid when the form opens.


AD Administrator Syncfusion Team July 25, 2003 03:26 PM UTC

If you add this to the formload, you will not see your message. this.gridDataBoundGrid1.ForceCurrentCellMoveTo = true; this.gridDataBoundGrid1.CurrentCell.MoveTo(2,1); The reason is that initially, there was no current cell. And your code is considering the currentcell as a selection.


GR grer July 25, 2003 04:27 PM UTC

so if there are multiple grids. I have to set all the grids with a current cell and this will keep for each grid?


AD Administrator Syncfusion Team July 25, 2003 04:30 PM UTC

Yes, I think it will work.

Loader.
Live Chat Icon For mobile
Up arrow icon