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

Problem with dynamically usercontrols

1 Answer 66 Views
Grid
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
Hi,

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

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

<div> 
<telerik:RadAjaxManager ID="radAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="grdResult"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="grdResult" LoadingPanelID="radAjaxLoadingPanel1"/> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
<telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel1" runat="server" Transparency="5"
</telerik:RadAjaxLoadingPanel> 
</div> 
 
<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" /> 
            <ClientEvents/> 
        </ClientSettings> 
        <GroupingSettings ShowUnGroupButton="true" /> 
    </telerik:RadGrid> 
 
</telerik:RadAjaxPanel> 
 
</asp:Panel> 

Thanks for answer.

Regards
Roman Krsko

1 Answer, 1 is accepted

Sort by
0
Pavlina
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,
Pavlina
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.
Tags
Grid
Asked by
Roman Krsko
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or