Hi
how do i possibly get the value of a hidden column (id) of a gridview binded in sqldatasource? i have this code in C# usng GridViewRow and DataKey Classes to retrieve it, I also set the DataKeyNames to "id".. here is the code:
GridViewRow gridViewRow;
DataKey dataKey;
gridViewRow = GridView.Select edRow;
dataKey = GridView.DataKe ys[gridViewRow.Row Index];
Label1.text = Convert.ToStrin g(dataKey.Value ); // This should display id value.
Once i fire this up, an exception occured: "Object reference not set to an instance of an object".
The code works fine in VB but in C# it doesnt. Please help me out.. Thank you so much.
how do i possibly get the value of a hidden column (id) of a gridview binded in sqldatasource? i have this code in C# usng GridViewRow and DataKey Classes to retrieve it, I also set the DataKeyNames to "id".. here is the code:
GridViewRow gridViewRow;
DataKey dataKey;
gridViewRow = GridView.Select edRow;
dataKey = GridView.DataKe ys[gridViewRow.Row Index];
Label1.text = Convert.ToStrin g(dataKey.Value ); // This should display id value.
Once i fire this up, an exception occured: "Object reference not set to an instance of an object".
The code works fine in VB but in C# it doesnt. Please help me out.. Thank you so much.
Comment