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

Need Column Header and Hidden Column row cell value on click

3 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 07 Dec 2011, 04:54 PM
I need to get the column header and the cell value of the row header (hidden column 0 cell text) for when someone clicks on the grid.

The examples I can find for this just don't work, maybe they are for the old radgrid and not for the new AJAX grid? 
I will do it client or server side.

When i try to do it server side I fail to get the column name and when I try to do it client side I can't get the hidden(visible = false) column(0)'s value for that row.
Any help is appreciated, I have been strugling with this for days.


3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 07 Dec 2011, 05:30 PM
Hello,

You can not able to get column which was visible = false because it was not rendered in clientside/in browser.
for that you have to used ClientDatakeyNames/DataKeyNames or hiddenfield.

by using datakey : -  Extracting key values client-side
by using control : Getting Cell Values for Selected Rows Client-side
http://www.telerik.com/community/forums/aspnet-ajax/grid/populate-radnumeric-box-in-radgrid-via-radcombobox-selection.aspx

Thanks,
Jayesh Goyani
0
Chris
Top achievements
Rank 1
answered on 07 Dec 2011, 06:10 PM
I tried the first option and if you try to add EnableClientKeyvalues="true" it gives the error EnableClientKeyvalues is not a valid attribute of ClientSettings....
I am going to try the second option.
0
Shinu
Top achievements
Rank 2
answered on 08 Dec 2011, 04:48 AM
Hello Chris,

Try the following code.
JS:
function OnRowSelecting(sender, args)
{
  var key=args.getDataKeyValue("Id");
  alert(key);
}
Note:Set ClientDataKeyNames as Id.

-Shinu.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Chris
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or