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

Pager functions stop working

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 23 Mar 2009, 06:04 AM
Hey there folks...

I'm running into a problem that seems to be new to the 2009.1.311 Radgrid.

Please note, the radgrid I am using is in a User control in Sitefinity 3.6

I have a grid using paging, and the paging style is set to NextPrevNumericAndAdvanced.

The Numeric buttons work fine.  However the "Page xxxx of xxxx" function stops firing after using any pager control the first time.

For example.  I start my page, I click the Next page button to go to page two.  If I try to enter page #  "100" and click Go, it does not work.

Another example.  I start my page, I enter page # 100 and click go... It works.  I then enter page # 105, and click Go.  It does not work.

This started happening with the 2009.1.311 Radgrid, and it only happens using ajax.

Anybody else running into this, or is this a new bug?

Thanks,

Kuba

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 26 Mar 2009, 11:16 AM
Hello Kuba,

My colleague Rosen already replied to your questions in the support ticket you opened with regards to this subject. I am posting his replies in this thread for additional reference:

Reply 1:
I suspect that the behavior you are experiencing is due to the fact that the RadGrid is not correctly updated after the ajax request is made and the scripts are not updated.

Usually when a UserControl are added to the page dynamically the most appropriate way to add the ajax setting will be inside UserControl's PreRender event handler, as this ensures that the controls are already placed in Page's controls collection. However in your case, where the RadAjaxManager itself is added when the UserControl is loaded, it is best if you add it inside UserControl's Init event. Thus the UserControl code should be modified similar to the following:


protected override void OnInit(EventArgs e)  
    {  
        base.OnInit(e);  
        //this replaces the RadAjaxManager declarative definition  
        RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);  
        if (ajaxManager == null)  
        {  
            ajaxManager = new RadAjaxManager();  
            ajaxManager.ID = "RadAjaxManager1";  
            ajaxManager.EnableHistory = true;  
            Page.Items.Add(typeof (RadAjaxManager), ajaxManager);  
            Page.Form.Controls.AddAt(0, ajaxManager);  
        }  
    }  
    protected override void OnPreRender(EventArgs e)  
    {  
        base.OnPreRender(e);  
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rgModuleGrid, rgModuleGrid, RadAjaxLoadingPanel1);  
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rgModuleGrid, rmpDetail);  
 
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rtbDetail, rtbDetail);  
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rtbDetail, rmpDetail, RadAjaxLoadingPanel1);  
 
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rmpDetail, rtbDetail);  
        RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(rmpDetail, rmpDetail, RadAjaxLoadingPanel1);  
    } 

Reply 2:
If I have understand you correctly you are not using the same setup from the previously attached user control? Can you please provide your new code?

As to your RadGrid's setting question, it highly depend on at which point  in page's lifecycle you are loading the RadGrid control itself and where and how the settings a modified. You may review this
online help article for more detailed information on the subject. Are you getting the same behavior when ajax is disabled?

You finally replied that the issues are resolved.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or