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

[Solved] Retrieve keys value when keys more than one

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ali Akhavan
Top achievements
Rank 1
Ali Akhavan asked on 12 Nov 2009, 12:29 PM
Hi,
i have a problem with RadGrid ,
I have a RadGrid with Two keys "TID,FID" and client side row selection

when i select a row and call RadGrid1.SelectedValue function only i see "TID" field value
please note me how i can Retrieve all keys values

Thanks
Akhavan

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Nov 2009, 12:46 PM
Hello Akhavan,

You can try out the following code to retrieve the key fields for the grid:
c#:
protected void btn_Click(object sender, EventArgs e) 
    {        
        foreach (GridDataItem dataItem in RadGrid1.SelectedItems) 
        { 
           string TID = dataItem.GetDataKeyValue("TID").ToString(); 
           string FID = dataItem.GetDataKeyValue("FID").ToString(); 
        } 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Ali Akhavan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or