Hi
I'm using a RadPanelBar in the NestedViewTemplate of my grid and would like to expand the RadPanelBar automatically when the NestedView for a particular row is shown (the NestedView is displayed when a row is clicked as follows):
function RowClicked(sender, args)var gridItem = args.get_item();ridItem.set_expanded(!gridItem.get_expanded());}If I expand the RadPanelBar server-side on page load then I lose the animation effect, so I would like to find the RadPanelBar client-side and run the .expand() method on it, something like this:
<div class="colorizedcode">var panelBar <font color="red">=</font> <font color="black">$find(</font><font color="purple">"<%= RadPanelBar1.ClientID %>"</font><font color="black">);<br>var panelItem</font> <font color="red">=</font> <font color="black">panelBar.findItemByText(</font> <font color="purple">"Paris"</font><font color="black">);<br>panelItem.disable();</font></div><span style=" "><span style=" margin-left: 0px !important;"><br></span></span>
The main problem seems to be that I'm having trouble finding the control in the RadPanelBar in the NestedViewTemplate client-side - I'm assuming that identifying the control client-side in function RowClicked will allow me to achieve what I'm looking for, which is a nice sliding effect when the NestedView is displayed. Additionally, I would like to collapse any other NestedViewTemplates if they are visible before displaying the template for the selected row.
The relevant bits of code for the RadGrid are below - any suggestions are greatly appreciated and please let me know if more information is required
Thanks
Brian
<telerik:RadGrid ID="grid_items" runat="server" DataSourceID="sqlds_items" GridLines="None"<br> AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" Skin="Sitefinity"<br> Font-Names="Trebuchet MS" ForeColor="#669999"><br> <ClientSettings><br> <Selecting AllowRowSelect="True" /><br> <ClientEvents OnRowClick="RowClicked" /><br> </ClientSettings><br> <MasterTableView DataKeyNames="itemID" DataSourceID="sqlds_items" ClientDataKeyNames="itemID"<br> HierarchyLoadMode="Client"><br>...
<NestedViewSettings DataSourceID="sqlds_itemImages"> <ParentTableRelation> <telerik:GridRelationFields MasterKeyField="itemID" /> <telerik:GridRelationFields DetailKeyField="itemID" /> </ParentTableRelation> </NestedViewSettings> <NestedViewTemplate> <div style="float: left; padding-left: 25px;"> <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="800px" Skin="Sitefinity"> <Items> <telerik:RadPanelItem runat="server" Text="some text here or remove?" Visible="True" Expanded="false"> <ContentTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/items/itemImages/bowl_whiteSmall.png" /> </ContentTemplate> </telerik:RadPanelItem> </Items> <ExpandAnimation Duration="500" Type="Linear"></ExpandAnimation> </telerik:RadPanelBar> </div> </NestedViewTemplate>