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

help with migrating from obscolete calls

3 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 29 Dec 2009, 10:13 PM

selected_id = (

string)((DataRow)((DataRecord)this.radGridView_A1.SelectedRecord).Data)[0];

DataRecord is gone, any sugguestions, Also, don't understrand why telerik posts examples (as of 3 months ago ) of apis that will be obscolete, wtf?


 

3 Answers, 1 is accepted

Sort by
0
Jorge Gonzalez
Top achievements
Rank 1
answered on 29 Dec 2009, 10:55 PM
I know what you mean Mark. I was trying to programmatically scroll the grid but selectedrecords and datarecord were gone. None of the examples using these two worked.
0
mark
Top achievements
Rank 1
answered on 29 Dec 2009, 11:04 PM
telerik, this is pos.. please provide how to migrate the code. this is not pretty..
0
Rossen Hristov
Telerik team
answered on 30 Dec 2009, 12:24 PM
Hi mark,

The properties that you mention were obsoleted in Q2 2009. With Q3 2009 they were removed. Our online examples are updated and they use the new properties.

There is no DataRecord anymore. You now have a direct access to the actual business object / entity that is selected by using the SelectedItem property. So if your grid is filled with DataRows the code will become something like this:

DataRow selectedItem = this.radGridView_A1.SelectedItem as DataRow;
if (selectedItem != null)
{
    var selected_id = (string)selectedItem[0];
}

Here you can see an online example of selection. It demonstrates how to use the SelectedItem and SelectedItems properties.

Please, let us know if you have any other questions or difficulties.

Kind regards,
Ross
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
mark
Top achievements
Rank 1
Answers by
Jorge Gonzalez
Top achievements
Rank 1
mark
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or