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

how to rebind radgrid within a panelbar from button

1 Answer 114 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
mac asked on 28 Nov 2008, 05:02 AM
hi. I have an issue that I can't seem to work around. I have a panelbar (pb1) on main.ascx. within pb1 i have two user controls each holding a radgrid ctlr1, and ctrl2 , respectively rg1 and rg2. I need a method to rebind rg1 and rg2 at the same time. For some reason I can't reference controls within the panelbar? What I was hoping to do was put a button on main.ascx, and using ajax manager control the two grids that way. This does work if I put a rg1.mastertableview.rebind()  in the rg1_prerender event. the problem though is obvious that every time i call an action on the grid, it rebinds, so that mean I can't collapse any grouped items. 
I'm pretty rookie at this type of thing so apologies if this should be very basic. my code is below for a basic setup
PS: I want to use a button to initiate the call as I am clicking it from a radwindow javascript.
note: sample is
        <asp:Button ID="Button1" runat="server" Text="Button" /><br /> 
        <br /> 
        <telerik:radpanelbar id="RadPanelBar1" runat="server" width="100%">  
<CollapseAnimation Type="None" Duration="100"></CollapseAnimation> 
<telerik:RadPanelItem runat="server" Text="Root RadPanelItem1" Expanded="True"><Items> 
<telerik:RadPanelItem runat="server" Text="child"><ItemTemplate> 
   <telerik:RadAjaxPanel runat="server" ID="rap1" > 
            <uc1:ctrl1 ID="Ctrl1_1" runat="server" /> 
<ExpandAnimation Type="None" Duration="100"></ExpandAnimation> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <telerik:AjaxSetting AjaxControlID="Button1">  
                        <telerik:AjaxUpdatedControl ControlID="Ctrl1_1" /> 

ctrl1 .ascx
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
    GridLines="None" ShowStatusBar="True">  
    <MasterTableView DataKeyNames="testid" DataSourceID="SqlDataSource1">  
        <telerik:GridGroupByField FieldName="fname" FieldAlias="fname" FormatString="" HeaderText="" /> 
        <telerik:GridGroupByField FieldName="fname" FieldAlias="fname" FormatString="" HeaderText="" /> 
            <telerik:GridBoundColumn DataField="testid" DataType="System.Int32" HeaderText="testid" 
                ReadOnly="True" SortExpression="testid" UniqueName="testid">  
            <telerik:GridBoundColumn DataField="fname" HeaderText="fname" SortExpression="fname" 
            <telerik:GridBoundColumn DataField="thedate" UniqueName="thedate" /> 
    <FilterMenu EnableTheming="True">  
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
</telerik:RadGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:4ConnectionString %>" 
    SelectCommand="SELECT  fname,testid,getdate() as thedate FROM [testtable]"></asp:SqlDataSource> 



Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender




End Sub


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 28 Nov 2008, 08:28 AM
Hi Mac,

I think it will be best if you can open a support ticket and send us a simple running project (incl. CSS, images, skins, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Thanks beforehand for your patience and cooperation,
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question