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

[Solved] getting value on client side (grid)

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
griselda sirvent
Top achievements
Rank 1
griselda sirvent asked on 02 Jan 2010, 02:03 PM
Hi
After several hours trying I've given up.
I am trying to get values client side when a row in grid is selected
I've used the following script but all I get is a box with "undefined" value
The column "CompanyName" exists on the database/grid, everything seems to be ok, so I don't understand what I am doing wrong ???
Rather frustrating...

Also note that I do have ClientDataKeyNames="ID" added to   <MasterTableView  ....
and ID is my Primary Key

Please help !!!


<script type="text/javascript"
 function RowSelected(sender, args) //Client side Rowselected event of radgrid
 { 
     alert(args.getDataKeyValue("CompanyName")); 
 } 
</script> 

1 Answer, 1 is accepted

Sort by
0
griselda sirvent
Top achievements
Rank 1
answered on 02 Jan 2010, 02:40 PM
Please disregard
I wanted to delete this ticket once but unable to do so.

For those interested, the problem was that all the values you want to extract from the row selected muts be mentioned on the "MasterTableView" like this:
<MasterTableView autogeneratecolumns="False" datakeynames="ID" ClientDataKeyNames="ID,ClientName,ClientAddress" datasourceid="SqlDataSource1">



On the example above, I would be able to retrieve 3 cells (ID, ClientName and ClientAddress)
If I wanted to extract more values, then I will add them there, separating them with commas like this:
ClientDataKeyNames="ID,ClientName,ClientAddress,ClientAddress2, ClientCity"

Hope that helps someone else !
Tags
Grid
Asked by
griselda sirvent
Top achievements
Rank 1
Answers by
griselda sirvent
Top achievements
Rank 1
Share this question
or