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

problem with DataKeyNames property

4 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mehdi Baatout
Top achievements
Rank 1
Mehdi Baatout asked on 23 Nov 2010, 11:04 AM
Hi,

I am trying to develop in my web page a RADGRID.

The DataSource of the Grid is a DataTable and I was create in the Grid an EditButton.

My problem is how I can point the DataKeyNames of the grid on the first column of the DataTable and how I can retrieve the key from the selected line by EditButton.

Thanks and Best Regards.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Nov 2010, 11:41 AM
Hello,


You will find out information about using/accessing data key values from the following link.
Retrieving primary key field values for selected items


-Shinu.
0
Mehdi Baatout
Top achievements
Rank 1
answered on 23 Nov 2010, 12:17 PM
Thanks Shinu

For specifiying the DataKeyNames column, how I do???
0
Accepted
Shinu
Top achievements
Rank 2
answered on 23 Nov 2010, 12:39 PM
Hello,


Set the MasterTableView - > DataKeyNames property accordingly.

ASPX:
<telerik:RadGrid
   ID="RadGrid1" runat="server"
   DataSourceID="AccessDataSource1"
   AutoGenerateColumns="false"
   OnItemCommand="RadGrid1_ItemCommand"
   OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
 <MasterTableView
     DataKeyNames= "CustomerID"
     DataSourceID="AccessDataSource1">
        . . .



-Shinu.
0
Mehdi Baatout
Top achievements
Rank 1
answered on 23 Nov 2010, 04:40 PM
Thanks
Tags
Grid
Asked by
Mehdi Baatout
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mehdi Baatout
Top achievements
Rank 1
Share this question
or