I have to run a javascript function on window Load..In the same function I planed to select a default for on the Grid..I have to do it on the client side...
Javascript
window.onload :function()
{
RowHightLight();
}
RowHightLight()
{
Var RadGrid=$find("<%=RadGrid1.ClientID%>");
(Object created sucessful ...NOW WHAT !!!??)
}
When I looked at the Forum and Documentation I see
$find("<%=RadGrid1.ClientID%>").get_
Javascript
window.onload :function()
{
RowHightLight();
}
RowHightLight()
{
Var RadGrid=$find("<%=RadGrid1.ClientID%>");
(Object created sucessful ...NOW WHAT !!!??)
}
When I looked at the Forum and Documentation I see
$find("<%=RadGrid1.ClientID%>").get_
masterTableView
()..get_dataItem()[2].set_selected(true);
But the problem is that I don't get any methods like get_masterTableView()...
Please help..
Thansk,
DIP
4 Answers, 1 is accepted
0
Hello Dip,
It depends on the version you used:
RadControls for ASP.NET AJAX:
RadControls for ASP.NET:
Additionally I want to suggest you use Page Load as shown below.
I hope this helps.
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
It depends on the version you used:
RadControls for ASP.NET AJAX:
var radGrid = $find("<%=RadGrid1.ClientID%>"); |
radGrid.get_masterTableView().get_dataItems()[0].set_selected(true); |
RadControls for ASP.NET:
var radGrid = window["<%=RadGrid1.ClientID%>"]; |
radGrid.MasterTableView.Rows[0].SetSelected(true, false); |
Additionally I want to suggest you use Page Load as shown below.
function pageLoad() |
{ RowHightLight(); } |
I hope this helps.
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Dip
Top achievements
Rank 1
answered on 03 Nov 2008, 02:07 PM
It is a Ajax Asp.net ...
If I do
var radGrid = $find("<%=RadGrid1.ClientID%>");
it says Undefined...
var radGrid = document.getElementById("<%=RadGrid1.ClientID%>");
Radgrid object is created but I can't highLight the row
If I do
var radGrid = $find("<%=RadGrid1.ClientID%>");
it says Undefined...
var radGrid = document.getElementById("<%=RadGrid1.ClientID%>");
Radgrid object is created but I can't highLight the row
0
Hello Dip,
Please test the following approach:
aspx (RadGrid declaration)
javascript
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Please test the following approach:
aspx (RadGrid declaration)
<ClientSettings ClientEvents-OnGridCreated="GridCreated" /> |
javascript
<script language="javascript" type="text/javascript"> |
var radGrid; |
function GridCreated(sender, args) |
{ |
radGrid = sender; |
} |
function RowHightLight() |
{ |
radGrid.get_masterTableView()... |
... |
} |
</script> |
Regards,
Daniel
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

joan
Top achievements
Rank 1
answered on 25 Feb 2009, 07:38 PM
Hi,
In my application, when edit a row, it opens a window with ShowEditForm as below:
In my application, when edit a row, it opens a window with ShowEditForm as below:
function
ShowEditForm(id, rowIndex) {
var grid = $find("<%= RadGrid1.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl,
true); //What does this line do? I want to high light the row.
window.radopen(
"ScheduleA.aspx?index=" + rowIndex, "ScheduleAWindow");
return false;
}
Can you help with where I put comments? I experimented with the code posted here with no success. It would be nice to high light the row during edit operation. The application uses RadControls Asp.netAjax, 2008 Q3 version.
thanks.