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

Grid DataKeys

2 Answers 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Borislava
Top achievements
Rank 1
Borislava asked on 11 Sep 2013, 11:57 AM
Is it posible to assign 2 datakeys to grid?

DataKeyNames

 

 

="CheckovID" ????? and "groupID"

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 11 Sep 2013, 12:02 PM
Hi ,

It's possible to set more than one DataKeyNames value.Please try the following code snippet.

ASPX:
<MasterTableView DataKeyNames="CheckovID,groupID" >

Thanks,
Princy
0
Jayesh Goyani
Top achievements
Rank 2
answered on 11 Sep 2013, 12:25 PM
Hello,

Answer is already in (property) Name because Property name is "DataKeyNameS" not the "DataKeyName".

DataKeyNames="CheckovID,groupID"

You  can access like:

string strCheckovID = item.GetDataKeyValue("CheckovID").ToString();
string strgroupID = item.GetDataKeyValue("groupID").ToString();


For Ex:

Allow only one filed
<telerik:GridBoundColumn DataField="ID"></telerik:GridBoundColumn>

Allow one or more then one fields

<telerik:GridHyperLinkColumn DataNavigateUrlFields="ID,Name"></telerik:GridHyperLinkColumn>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Borislava
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayesh Goyani
Top achievements
Rank 2
Share this question
or