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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Event for capturing row selectiom

Thread ID:

Created:

Updated:

Platform:

Replies:

5335 Jun 30,2003 04:14 PM UTC Jul 25,2003 04:30 PM UTC Windows Forms 10
loading
Tags: GridControl
grer
Asked On June 30, 2003 04:14 PM UTC

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

Administrator [Syncfusion]
Replied On June 30, 2003 08:44 PM UTC

Try SelectionChanging or SelectionChanged.

grer
Replied On 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

Administrator [Syncfusion]
Replied On 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 .....

grer
Replied On July 2, 2003 12:14 PM UTC

many thanks

grer
Replied On 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?

Administrator [Syncfusion]
Replied On 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?

grer
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

grer
Replied On 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?

Administrator [Syncfusion]
Replied On July 25, 2003 04:30 PM UTC

Yes, I think it will work.

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

;