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

RadGrid PreRender

1 Answer 268 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 13 Feb 2009, 12:35 AM
Here is my situation, this might not be the best solution, but it almost works:

I have a master page with a radmenu in it.  The menu item is a template item and in it I have a radajaxpanel (is this advised?).  This menu item shows a folder structure that i created along with a text box that lets you type ahead to filter the folders that show in the menu updating the radajaxpanel.   This works great on most pages, however, on pages where the child page contains a rad grid, the rad grids PreRender method keeps getting called which dramatically slows down the type ahead.  Who is calling the PreRender method?  Any ideas on how to track that down.  I put break points everywhere but it just keeps going into PreRender and I can't tell why it goes in there.  It never calls the NeedDataSource method.

This is in the RadCodeBlock
function SearchFolders() { 
                var tb = $get('<%=RadMenu1.Items[0].Items[0].FindControl("FolderSearchPhrase").ClientID%>'); 
                if (tb.value == "") { 
                    //var ajaxMgr = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>"); 
                    //ajaxMgr.ajaxRequest("ResetTree"); 
                    var ajaxPanel = $find('<%=RadMenu1.Items[0].Items[0].FindControl("RadAjaxPanel1").ClientID %>'); 
                    ajaxPanel.ajaxRequest("ResetTree"); 
                } 
                else { 
                    //var ajaxMgr = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>"); 
                    //ajaxMgr.ajaxRequest("SearchFolders"); 
                    var ajaxPanel = $find('<%=RadMenu1.Items[0].Items[0].FindControl("RadAjaxPanel1").ClientID %>'); 
                    ajaxPanel.ajaxRequest("SearchFolders"); 
                } 
            }  

Code Behind of master page
protected void PanelRequest(object sender, AjaxRequestEventArgs e) 
    { 
if (e.Argument == "ResetTree"
        { 
            thisUser = new User(2); 
            Folder f = new Folder(); 
            if (Request.QueryString["folderid"] == null || Request.QueryString["folderid"] == ""
            { 
                f.FolderID = 0; 
            } 
            else 
            { 
                f.FolderID = Convert.ToInt32(Request.QueryString["folderid"]); 
            } 
            FolderList fl = new FolderList(thisUser, f, thisUser); 
            Session["FolderList"] = fl; 
            HiddenField TreePageNum = (HiddenField)RadMenu1.Items[0].Items[0].FindControl("TreePageNum"); 
            TreePageNum.Value = "1"
            m_Pagenum = Convert.ToInt32(TreePageNum.Value); 
            LoadTreePanel(); 
        } 
        else if (e.Argument == "SearchFolders"
        { 
            thisUser = new User(2); 
            TextBox searchPhrase = (TextBox)RadMenu1.Items[0].Items[0].FindControl("FolderSearchPhrase"); 
            FolderList fl; 
            if (searchPhrase.Text.Trim().Length == 0) 
            { 
                Folder f = new Folder(); 
                if (Request.QueryString["folderid"] == null || Request.QueryString["folderid"] == ""
                { 
                    f.FolderID = 0; 
                } 
                else 
                { 
                    f.FolderID = Convert.ToInt32(Request.QueryString["folderid"]); 
                } 
                fl = new FolderList(thisUser, f, thisUser); 
            } 
            else 
            { 
                fl = new FolderList(thisUser, searchPhrase.Text); 
            } 
            Session["FolderList"] = fl; 
            HiddenField TreePageNum = (HiddenField)RadMenu1.Items[0].Items[0].FindControl("TreePageNum"); 
            TreePageNum.Value = "1"
            m_Pagenum = Convert.ToInt32(TreePageNum.Value); 
            LoadTreePanel(); 
        } 
    }

LoadTreePanel ends with this
        Panel TreePanel = (Panel)RadMenu1.Items[0].Items[0].FindControl("TreePanel"); 
        TreePanel.Controls.Clear(); 
        TreePanel.Controls.Add(new LiteralControl(html.ToString())); 

Anything here that would cause the child page to fire the RadGrid's PreRender

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 16 Feb 2009, 03:54 PM
Hello John,

Can you confirm that only the RadGrid PreRender method is fired unexpectedly but any other Page event?
I would suggest that you set up a small runnable project and send it to us in a formal support ticket for further investigation and testing.

Looking forward your reply,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
John
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or