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 04:44 PM

Try SelectionChanging or SelectionChanged.


GR grer July 1, 2003 07:48 AM

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 04:57 PM

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 08:14 AM

many thanks


GR grer July 24, 2003 04:14 AM

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 06:38 AM

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 09:44 AM

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 11:26 AM

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 12:27 PM

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 12:30 PM

Yes, I think it will work.

Loader.
Live Chat Icon For mobile
Up arrow icon