Data Grid --> Data Key Field
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
In my Web form I have DataGrid1 and want to add 2 cols in DataGrid1.DataKeyField property. If I had 1 col. it would be DataGrid1.DataKeyField = "ColName1", but how can I add another more "ColName2"?
Hi, If you r working on asp.net 2.0 then to get this facility you should use GridView Control. Gridview has property called "DataKeyNames" which you can set to comma separated column names and you can access their values as following. gv.DataKeys[keindex].Values[columnindex].ToString() I hope this will help you.
Thanks and Regards, Chetan Ranpariya