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

Subclassing Grid - problems

3 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
pr ga
Top achievements
Rank 1
pr ga asked on 20 Apr 2010, 12:53 PM
Hi,

I am trying to subclass RadGrid control as follows :

 public class TestGridView : RadGrid
{
}

In Oninit function of the class I have added:
RadAjaxManager1  = RadAjaxManager.GetCurrent(this.Page);

And onLoad function of the class I have added
if (RadAjaxManager1 != null)
           {         
               RadAjaxManager1.AjaxSettings.AddAjaxSetting(this, this);              
           }




I compile this into dll and use it in my web project.
I do have a master page whereby i have added above contentholder:

 <asp:ScriptManager runat="server" ID="ScriptManage1"></asp:ScriptManager>
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true">
 </telerik:RadAjaxManager>

The problem is the Grid is not getting updated on paging or sorting..nothing works
But if i use asp.net update panel it gets updated with few bugs though.

Please if anyone can give me best example of sub classing RadGrid with RadAjaxManager working with complete sorting and paging..

Thanks.


3 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 23 Apr 2010, 06:27 AM
Hi pr ga,

The approach you have taken is generally correct. The problem is RadAjaxManager.GetCurrent() will not work as early as Init. The reason - RadAjaxManager is registered on the page in the Init phase, and you may be trying to reference it earlier than that. Try using the Load phase for both referencing the control and adding its AJAX settings.

All the best,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
pr ga
Top achievements
Rank 1
answered on 05 May 2010, 06:32 AM
Hi,

Thanks for your reply.

I did the same by writing both the lines in OnLoad function of my class.

Still the grid is not working. The data gets loaded but nothing works afterward.
Any clicks,sorting,paging does not works...
I also have the grid inside the Update Panel of asp.net but still not working.
I also tried removing the Update Panel but still now working.

Please if you can give me small sample code for sub classing with the ajax manager than it will be really helpful.

Thank You.
0
Veli
Telerik team
answered on 10 May 2010, 01:01 PM
Hi pr ga,

I would be using the same approach you have taken, really. I would find the manager in Load and register my AJAX settings there. The code I would recommend is no more different than using  the Load event to both find the manager and register AJAX settings, as you do.

Are you getting any javascript errors on the page? Is the grid working OK without any AJAX setup? If any of those two conditions are violated, you may want to look for the source of this issue elsewhere. If you paste your subclassed RadGrid, I can go through it and try to identify something.

Sincerely yours,
Veli
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
pr ga
Top achievements
Rank 1
Answers by
Veli
Telerik team
pr ga
Top achievements
Rank 1
Share this question
or