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

How can I get the instance of Grid at client which be loaded on demand!

3 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan Cao
Top achievements
Rank 1
Dan Cao asked on 23 Apr 2013, 05:41 PM
Hi,

Currently, I don't know how to get the Grid at client site for the case below

1. I have a user control which contains a RadGrid control inside
2. I don't load this user control at the first time load of the page
3. When user clicks on the "Load" button, I will call back to the server via Ajax to render the content of the User Control above and set this data to the DIV element

Now, I can show entire content of that user control to the screen however I don't know how to get the Grid object inside that user control.

It always returns NULL when I use: var grid = $find(radGridClientId);

So my question is How can I get back the Grid in that case?

Any helps is appreciated,
Thanks,
Dan

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 26 Apr 2013, 10:14 AM
Hello Dan,

I am sending you a simple example which demonstrates how to achieve the desired functionality. Please check it out and let me know if it helps you.

Looking forward for your reply.

Kind regards,
Radoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Dan Cao
Top achievements
Rank 1
answered on 26 Apr 2013, 01:19 PM
Thank you Radoslav.

I think your simple project is not suitable with my situation. In your project, you used post back to load the UserControl to the Panel, thus you can easy use $find(gridId) to get the Grid at client.

However, my situation is I called the Ajax service to get the Content of User Control which have the RadGrid inside. After get the content, I inject that content to DIV element and with that way I can not get the Grid instance at client side by $find(gridId)

Please help me on that specific case, thank you
Dan
0
Maria Ilieva
Telerik team
answered on 01 May 2013, 07:56 AM
Hello Dan,

The provided application actually does not perform regular postback to load the UserControl but mostly use an ajax request to load the mentioned UserControl which contains the RadGrid. As your case appears to be a bit different, could I kindly ask you to share your exact page markup as well as the related code behind or open a regular suppport ticket where you could send a runnable sample which demonstrates the issue? Thus we will be able to review the exact approach you are using and do our best to provide the best solution for your specific case.

Greetings,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Dan Cao
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Dan Cao
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or