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

2 Level Grid Questions

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arroyocode
Top achievements
Rank 1
Arroyocode asked on 19 Aug 2008, 03:34 PM
Hello forumees,

I have the following 2 level grid in place. I have combed forums and guides and am miffed. I need the ability to click(select) the second level(nested) grid ONLY and also ensure only one grid node can be expanded at any time? If anybody has source, i'd be happy to explore and thanks for the help. Ajax manager left out for brevity. Please excuse VPC: in place of telerik: tagnames.

Here's current code:

<VPC:RadGrid ID="kitsPerUserGrid" Width="445" AutoGenerateColumns="false" GridLines="None" AllowMultiRowSelection="true" OnDetailTableDataBind="AssignedKitsPerUserDetailTableDataBind" EnableEmbeddedSkins="false" Skin="SonyGrid" runat="server">  
                                    <ClientSettings> 
                                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> 
                                        <ClientEvents OnRowContextMenu="RowContextMenu"  /> 
                                    </ClientSettings> 
                                    <MasterTableView DataKeyNames="AssignedUser">  
                                        <DetailTables> 
                                            <VPC:GridTableView DataKeyNames="AssignedUser" GroupsDefaultExpanded="true" Name="assignedUserKitDetails" Width="100%" GridLines="None">  
                                                <Columns> 
                                                    <VPC:GridClientSelectColumn /> 
                                                    <VPC:GridBoundColumn DataField="RecId" UniqueName="RecId" ReadOnly="true" ItemStyle-Width="15%" /> 
                                                    <VPC:GridBoundColumn DataField="Kits" UniqueName="Kits" ReadOnly="true" ItemStyle-Width="50%" /> 
                                                    <VPC:GridBoundColumn DataField="Parts" UniqueName="Parts" ReadOnly="true" ItemStyle-Width="25%" /> 
                                                    <VPC:GridBoundColumn DataField="UsersOrder" UniqueName="UsersOrder" ItemStyle-Width="10%" /> 
                                                </Columns> 
                                                <NestedViewTemplate> 
                                                    <fieldset> 
                                                        <legend>&nbsp;&nbsp;Part(s) for Kit:   
                                                            <asp:Label ID="RecID" Text='<%# Eval("RecId") %>' Visible="false" runat="server" /> 
                                                            <asp:Label ID="KitsSmallDescription" Text='<%# Eval("Kits") %>' runat="server" />&nbsp;&nbsp;  
                                                        </legend> 
                                                        <asp:SqlDataSource ID="AssignedKitDetailsDataSource" ConnectionString="<%$ ConnectionStrings:SLManagerConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT PartNum, Description, Qty FROM SLM_Parts where KitID = @RecId" runat="server">  
                                                            <SelectParameters> 
                                                                <asp:ControlParameter ControlID="RecID" PropertyName="Text" Type="String" Name="RecId" /> 
                                                            </SelectParameters> 
                                                        </asp:SqlDataSource> 
                                                        <VPC:RadGrid ID="assignedNestedKitGrid" Width="100%" GridLines="None" AutoGenerateColumns="false" EnableEmbeddedSkins="false" Skin="SonyGrid" DataSourceID="AssignedKitDetailsDataSource" runat="server">     
                                                            <ClientSettings /> 
                                                            <MasterTableView> 
                                                                <Columns> 
                                                                    <VPC:GridBoundColumn DataField="PartNum" UniqueName="PartNum" ItemStyle-Width="20%" /> 
                                                                    <VPC:GridBoundColumn DataField="Description" UniqueName="Description" ItemStyle-Width="68%" /> 
                                                                    <VPC:GridBoundColumn DataField="Qty" UniqueName="Qty" ItemStyle-Width="12%" /> 
                                                                </Columns> 
                                                            </MasterTableView>                                    
                                                        </VPC:RadGrid>                                    
                                                    </fieldset> 
                                                </NestedViewTemplate> 
                                            </VPC:GridTableView> 
                                        </DetailTables> 
                                        <Columns> 
                                            <VPC:GridBoundColumn DataField="AssignedUser" UniqueName="AssignedUser"  ItemStyle-Width="50%" /> 
                                            <VPC:GridTemplateColumn DataField="Quantity" UniqueName="QuantityColumn" ItemStyle-Width="50%">  
                                                <ItemTemplate> 
                                                    <%# Eval("Quantity") %> Kit(s)  
                                                    <asp:Label ID="UserIdentity" Text='<%# Eval("AssignedUser") %>' Visible="false" runat="server" /> 
                                                </ItemTemplate> 
                                            </VPC:GridTemplateColumn> 
                                        </Columns> 
                                    </MasterTableView> 
                                </VPC:RadGrid> 

Thank you!

1 Answer, 1 is accepted

Sort by
0
Nikita Gourme
Top achievements
Rank 1
answered on 22 Aug 2008, 01:10 PM
Hi again Greg,

Check my recent reply here.

Cheers,
Nikita
Tags
Grid
Asked by
Arroyocode
Top achievements
Rank 1
Answers by
Nikita Gourme
Top achievements
Rank 1
Share this question
or