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

[Solved] client object in onload event

2 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eliyahu Goldin
Top achievements
Rank 1
Eliyahu Goldin asked on 17 Jun 2008, 10:07 AM
I need to perform some actions on the grid on the original page load, not in Ajax calls:
<body onload="setupTopButtons()">

Please tell me how can I accees the grid client object from within setupTopButtons(). All examples I see refer to something like 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript"> 
 var grid = $find("<%=RadGrid1.ClientID %>"); 
 //execute some logic here
</script>
</telerik:RadCodeBlock>

which sets var grid to null on the original page load.

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 17 Jun 2008, 10:56 AM
Hi Eliyahu,

In ASP.NET AJAX you can use Sys.Application.load event:

 function pageLoad(sender, args) 
 { 
    var grid = $find("<%=RadGrid1.ClientID %>");  
 } 


Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Eliyahu Goldin
Top achievements
Rank 1
answered on 17 Jun 2008, 08:22 PM
This worked, thank you.
Tags
Grid
Asked by
Eliyahu Goldin
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Eliyahu Goldin
Top achievements
Rank 1
Share this question
or