This is a migrated thread and some comments may be shown as answers.

Row Selection Events

3 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raymundo Lopez
Top achievements
Rank 1
Raymundo Lopez asked on 11 Nov 2009, 03:59 PM
Good Afternoon,

I recently upgraded to the new Radcontrols for Winforms 2009 Q3 and noticed an issue with code that was previously working.

In my grid's I was handling the "CurrentRowChanged" event as it seemed this event would fire after the current row had changed allowing me to look at "GridView1.CurrentRow.GridViewInfo.CurrentIndex" to get the new index of the row that was selected. From this I was able to get some information from a specific Cell that contained an ID and query my database to load assocaited information.

Unfortuantely since installing 2009 Q3, this event still fires, but the resulting Index is always 0 even though the grid itself visually does display the highlighted row properly.

Has something changed with the "CurrentRowChanged" event, should I be using "SelectionChanged" instead? If so I could not find any exampled for "SelectionChanged"

In reality all I am wanting to do is get the index of the newly selected row after it is clicked on.

Any help would be apprecaited.

Thank You,

Chris Eisnaugle

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 12 Nov 2009, 05:10 PM
Hello Raymundo Lopez,

As you may know, we changed our scrolling mechanism in Q3 2009 (for more information see What's New and the detailed Release Notes). The change introduced the described issue with the CurrentIndex property. We are aware of this issue and it will be addressed in one of our upcoming releases. You can use MasterGridViewTemplate.Rows.IndexOf method instead or access the CurrentRow property directly. If you need further assistance with this I will be glad to help.
 

Kind regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
john
Top achievements
Rank 1
answered on 16 Nov 2009, 08:41 PM
i.e.
int RowIndex = MyGridName.MasterGridViewTemplate.Rows.IndexOf(   (GridViewDataRowInfo) e.CurrentRow)
0
Jack
Telerik team
answered on 18 Nov 2009, 04:59 PM
Hello john,

Thank you for this example. In our upcoming releases the case will not be necessary.
 

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Raymundo Lopez
Top achievements
Rank 1
Answers by
Jack
Telerik team
john
Top achievements
Rank 1
Share this question
or