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
main.ascx
ctrl1 .ascx
ctrl1.ascx.vb
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
main.ascx
| <asp:Button ID="Button1" runat="server" Text="Button" /><br /> |
| <br /> |
| <telerik:radpanelbar id="RadPanelBar1" runat="server" width="100%"> |
| <CollapseAnimation Type="None" Duration="100"></CollapseAnimation> |
| <Items> |
| <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" /> |
| </telerik:RadAjaxPanel> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| <ExpandAnimation Type="None" Duration="100"></ExpandAnimation> |
| </telerik:radpanelbar> |
| </div> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="Button1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Ctrl1_1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
ctrl1 .ascx
| <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" |
| GridLines="None" ShowStatusBar="True"> |
| <MasterTableView DataKeyNames="testid" DataSourceID="SqlDataSource1"> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldName="fname" FieldAlias="fname" FormatString="" HeaderText="" /> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="fname" FieldAlias="fname" FormatString="" HeaderText="" /> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <Columns> |
| <telerik:GridBoundColumn DataField="testid" DataType="System.Int32" HeaderText="testid" |
| ReadOnly="True" SortExpression="testid" UniqueName="testid"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="fname" HeaderText="fname" SortExpression="fname" |
| UniqueName="fname"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="thedate" UniqueName="thedate" /> |
| </Columns> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </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
RadGrid1.Rebind()
End Sub