radgrid +own server control +update panel

2 posts, 0 answers
  1. Łukasz Kuryło
    Łukasz Kuryło avatar
    24 posts
    Member since:
    Jan 2010

    Posted 02 Feb 2010 Link to this post

    Hi all.
    I have a own server control which derive from RadGrid
    public class MyGrid : Telerik.Web.UI.RadGrid{}

    I want to render that control in the update panel (I don't want the postback to the server when e.g. I want to sort data in column).
    How can i do that?

    My code at this moment.
            protected override void CreateChildControls() 
            { 
                base.CreateChildControls(); 
                Control parent; 
                Control container; 
     
                ScriptManager sm = ScriptManager.GetCurrent(Page); 
     
                if (sm == null || !sm.EnablePartialRendering) 
                { 
                    container = new Control(); 
                    parent = container; 
                } 
                else 
                { 
                    UpdatePanel up = new UpdatePanel(); 
                    container = up.ContentTemplateContainer; 
                    parent = up; 
                } 
     
                this.Controls.Add(parent); 
            } 
     
            protected override void RenderContents(HtmlTextWriter output) 
            { 
                EnsureChildControls(); 
                 
               //parent.RenderControl(output); 
                base.RenderContents(output); 
            } 

    [edit]
    I'va found a RadAjaxManager control. Maybe this will be better for this solution than update panel, but still I don't know how to render my derived class with this control. I need this all in one dll file.
  2. Łukasz Kuryło
    Łukasz Kuryło avatar
    24 posts
    Member since:
    Jan 2010

    Posted 02 Feb 2010 Link to this post

    All right.
    After a few hours I did it.

            protected override void OnPreRender(EventArgs e) 
            { 
                RadAjaxManager m = RadAjaxManager.GetCurrent(this.Page); 
                m.AjaxSettings.AddAjaxSetting(thisthis); 
                base.OnPreRender(e); 
            }   

    It's simpler than I expected.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top