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

ROW ID

2 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhruval Dave
Top achievements
Rank 1
Dhruval Dave asked on 20 Apr 2011, 10:36 AM
I am Binding Rad Grid.
And i am using Radcontext Menu.
Now i Want to retrive the ID of Selected Row.

How to do it. ?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Apr 2011, 01:02 PM
Hello,

I am not quite sure about your requirement and I suppose you want to access the DataKeyvalue of selected row. If thats the case try the following code-snippet.
C#:
protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
   
       GridDataItem dataItem = (GridDataItem)RadGrid1.SelectedItems[RadGrid1.SelectedItems.Count - 1]; 
       string ID = dataItem.GetDataKeyValue("ID").ToString();    
   }

Or if you want to access the RadGrid selectedRow on ContextMenuItemClick, The following documentation will help you to get an idea of achieving the same.
AJAX-enabled context menu.

Regards,
-Shinu
0
Dhruval Dave
Top achievements
Rank 1
answered on 21 Apr 2011, 05:52 AM
Thnx a lot Shinu
Tags
Grid
Asked by
Dhruval Dave
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dhruval Dave
Top achievements
Rank 1
Share this question
or