Scriptmanager error while using RenderControl

2 posts, 0 answers
  1. Kishan Gandikota
    Kishan Gandikota avatar
    44 posts
    Member since:
    Sep 2009

    Posted 28 Nov 2011 Link to this post


    I have a asp .net page which has RadGrid inside the page. My objective is: on click of a button on the page, i need to get the rendered html of the radgrid so that i can do more processing (for printing/taking screenshots of the grid alone).

    <telerik:RadGrid ID="grid1" ShowFooter="true"
                OnNeedDataSource="grid1_NeedDataSource" ShowStatusBar="true" runat="server" OnItemDataBound="GridCollateralDataBound"
                <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" AllowColumnHide="true" ColumnsReorderMethod="Reorder">
                    <Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="false"  />


    I have the button which tries to get the render html for this page but it unfortunately fails.

    void ButtonClick(object sender, EventArgs e)
                    System.IO.StringWriter stringWriter = new System.IO.StringWriter();
                    HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);

                    if (stringWriter != null)
                    if (htmlWriter != null)

    Here "grid1.RenderControl" code throws error that "Script control 'rghcMenu' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
    Parameter name: scriptControl".

    I tried setting grid1's RegisterWithScriptManager to false before calling rendercontrol and also tried adding the scriptmanager explicitly for grid1 (added a panel with scriptmanager at run-time and and then grid1 inside). All these options still were still throwing the same error.

    Your help on this is appreciated.

    Note: I am using the latest version of telerik radgrid: 2011.2.915.40

    Kishan G K
  2. Kishan Gandikota
    Kishan Gandikota avatar
    44 posts
    Member since:
    Sep 2009

    Posted 08 Dec 2011 Link to this post

    Hi Telerik Team,

    Can you please put your thoughts on this issue?

    Kishan G K
  3. DevCraft R3 2016 release webinar banner
Back to Top