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

Problem with dynamically usercontrols

1 Answer 48 Views
This is a migrated thread and some comments may be shown as answers.
Roman Krsko
Top achievements
Rank 1
Roman Krsko asked on 30 Mar 2010, 03:02 PM

I have problem with loadcontrol also.
If I load control on server side:
Control userControl = LoadControl("usercontrols/result/resultgrid.ascx");

I have problem with client script on RadGrid. Some client ajax function are not ok (paging, page size, grouping, I see ajax load image only first time then only when refresh pages...).
I I load control as <uc1:ResultGrid ID="ResultGrid1" runat="server" /> all is OK.
But I need add control dynamically :(

Inside my usercontrol I have only RadGrid

<telerik:RadAjaxManager ID="radAjaxManager1" runat="server"
        <telerik:AjaxSetting AjaxControlID="grdResult"
                <telerik:AjaxUpdatedControl ControlID="grdResult" LoadingPanelID="radAjaxLoadingPanel1"/> 
<telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel1" runat="server" Transparency="5"
<asp:Panel ID="panelView1" runat="server"
<telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server"
    <telerik:RadGrid ID="grdResult" runat="server" AllowPaging="True" PageSize="15" 
            ShowGroupPanel="True" GridLines="None" onitemdatabound="grdResult_ItemDataBound" 
            AllowSorting="True" RegisterWithScriptManager="true" onneeddatasource="grdResult_NeedDataSource"
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <ClientSettings AllowDragToGroup="True"
            <DataBinding EnableCaching="true" /> 
            <Selecting AllowRowSelect="true" /> 
        <GroupingSettings ShowUnGroupButton="true" /> 

Thanks for answer.

Roman Krsko

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 02 Apr 2010, 09:59 AM
Hello Roman,

The dynamic loading of user controls follows the same logic as in normal postback application. Please refer to the online resources below for more information about how to achieve your goal.
Load user controls
Online demo - Loading User Controls

Give them a try and let me know if the problem still persists.

Kind regards,
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.
Asked by
Roman Krsko
Top achievements
Rank 1
Answers by
Telerik team
Share this question