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

Event for capturing row selectiom

Thread ID:





5335 Jun 30,2003 04:14 PM UTC Jul 25,2003 04:30 PM UTC WinForms 10
Tags: GridControl
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.

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 .....

Replied On July 2, 2003 12:14 PM UTC

many thanks

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?

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.

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon