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

[Solved] Client Side Grid Access in promoetheus

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 28 Apr 2008, 04:28 PM
I'm converting my radgrid/ajax to prometheus and in doing so my client - side access is breaking with the 'mastertableview.rows is null blah blah blah'

function ShowEditTree(rowIndex)

{

var grid = window["<%= RadGrid1.ClientID %>"];

var rowControl = grid.MasterTableView.Rows[rowIndex].Control;

grid.MasterTableView.SelectRow(rowControl,

true);

var tf = grid.MasterTableView.GetCellByColumnUniqueName(grid.MasterTableView.Rows[rowIndex], "CourseID");

var CourseID = tf.innerHTML ;

}
I've changed the client setting required by prometheus to enable AllowRowSelect(which was a change from the previous version).

<

ClientSettings EnableRowHoverStyle="True" >

<

Selecting AllowRowSelect="True" />

<

ClientEvents OnRowClick="Dummy"></ClientEvents>

</

ClientSettings>

What am I missing?

2 Answers, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 28 Apr 2008, 06:33 PM
I found this - http://www.telerik.com/help/radcontrols/prometheus/?grdMigrationToPrometheus.html

wow, thats quite a change, we have dozens if not hundreds of these client side functions in place, can anyone help me translate to the new API using my JS as an example?

thanks very much

0
david
Top achievements
Rank 1
answered on 28 Apr 2008, 07:03 PM
OK, figured it out, the new API looks like this

var mtv = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

mtv.selectItem(mtv.get_dataItems()[rowIndex].get_element());

var selectedRows = mtv.get_selectedItems();

var row = selectedRows[0];

var tf = mtv.getCellByColumnUniqueName(row, "CourseID")

var CourseID = tf.innerHTML ;

Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Share this question
or