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

Get Grid Row as DataSourceObject

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 27 Jan 2011, 10:17 PM
How can I get a row from the Grid as the DataSource Object...

e.g. Customer cust = RadGrid.GetRow() as Customer; ?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 31 Jan 2011, 12:01 PM
Hi George,

You could get the object to which the RadGrid's row is bound on RadGrid.ItemDataBound event form DataItem property:
if(e.Item is GridDataItem)
{
    GridDataItem item = e.Item as GridDataItem;
    Customer cust = item.DataItem as Customer;
}

Please give it try and let me know if you experience any problems.

Regards,
Radoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or