8 Answers, 1 is accepted
0

Elliott
Top achievements
Rank 2
answered on 18 Oct 2011, 04:47 PM
you didn't say at what point or on what event you need this information
to get the unique name, the MasterTableView Columns collection, which is indexed, can give you the UniqueName on the server
- you'll need to know (or figure out) what kind of Column it is (GridBoundColumn, etc)
there is a get_columns() function for the MasterTableView object on the client which may get you what you want
as for the Text, once you have the UniqueName you can drill down into the Controls in the TableCell
to get the unique name, the MasterTableView Columns collection, which is indexed, can give you the UniqueName on the server
- you'll need to know (or figure out) what kind of Column it is (GridBoundColumn, etc)
there is a get_columns() function for the MasterTableView object on the client which may get you what you want
as for the Text, once you have the UniqueName you can drill down into the Controls in the TableCell
0

LamKhoa
Top achievements
Rank 1
answered on 19 Oct 2011, 12:56 AM
Would you please give me an example?
Thanks
John
Thanks
John
0

Elliott
Top achievements
Rank 2
answered on 19 Oct 2011, 02:26 PM
Dim
aCol as GridBoundColumn=(GridBountColumn)RadGrid1.MasterTableView.Columns(2)
Dim
strUnq = aCol.UniqueName
0

LamKhoa
Top achievements
Rank 1
answered on 19 Oct 2011, 02:42 PM
Thanks.
Would you please also give me the sample code for client-side as well?
Thanks
Lamk.
Would you please also give me the sample code for client-side as well?
Thanks
Lamk.
0
Accepted

Elliott
Top achievements
Rank 2
answered on 19 Oct 2011, 02:51 PM
var
grid = sender;
var
MasterTable = grid.get_masterTableView();
var
id = MasterTable.get_columns()[0].get_uniqueName();
0

LamKhoa
Top achievements
Rank 1
answered on 19 Oct 2011, 03:37 PM
Thanks,
It works great.
Lamk
It works great.
Lamk
0

Chris
Top achievements
Rank 1
answered on 05 Dec 2011, 10:04 PM
Is it possible to change this so that it's not locked to column 0, but instead the column that was clicked?
I figured it out: I can use the index to get the column name and pass it back to the server instead of the column index.
I figured it out: I can use the index to get the column name and pass it back to the server instead of the column index.
<
script
type
=
"text/javascript"
>
function rowClick(sender, args) {
var grid = sender;
var MasterTable = grid.get_masterTableView();
var cellindex = args.get_domEvent().target.cellIndex
var id = MasterTable.get_columns()[cellindex].get_uniqueName();
sender.get_masterTableView().fireCommand("CellClick", id + "|" + args.get_domEvent().target.innerHTML);
}
</
script
>
0

Elliott
Top achievements
Rank 2
answered on 07 Dec 2011, 03:50 PM
"If I know the column index"
substitute the column index instead of 0
substitute the column index instead of 0