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

RadGridview Getting the SelectedRow

1 Answer 3054 Views
GridView
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 06 Feb 2009, 02:41 PM
Hi,

I am struggling to find an equivalent event to the generic gridview selectedrow.

I'm currently using the fowwing code, but i feel there must be a more appropriate way of completing this task.

 

int selectedindex = gvOffSite.Rows.IndexOf((GridViewDataRowInfo)gvOffSite.CurrentRow);

 

SelectedID = (

int)gvOffSite.Rows[selectedindex].Cells["EntityID"].Value;

 


In brief i want to use data from the radgridview selected row, something similar to this i hope;

this.radgridview1.selectedrow.cell[i].value.... etc etc

Can anyone help please?
Regards
Chris

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Feb 2009, 01:31 PM
Hi,

If you really need to get the SelectedRow of RadGridView, please consider the following approach:
this.radGridView1.SelectedRows[0].Cells["Picture Name"].Value 

However, in scenarios where the MultiSelect property is false, SelectedRows[0] is equal to CurrentRow, so you can use the following code:
this.radGridView1.CurrentRow.Cells[0].Value 

I hope this helps. If you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
IT
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or