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

[Solved] NestedView inside GroupBy

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gridiron
Top achievements
Rank 1
gridiron asked on 05 Feb 2010, 01:30 PM
Hi,

I had a group by grid working well and then added a nested view to allow extra details to be displayed for a selected item.  It all works - expanding collapsing groups until I expand one of the nested views - then the group expansion/collapse is broken until I refresh the view.

Any ideas?  Here's a portion of the code...

 

 

        <telerik:RadGrid ID="HitRadGrid" runat="server" 
            AllowCustomPaging="True" 
            AllowMultiRowSelection="True"   
            AllowPaging="True"   
            AllowSorting="False"   
            AutoGenerateColumns="False" 
            ShowGroupPanel = "false" 
            SortingSettings-EnableSkinSortStyles="false" 
            SortingSettings-SortedAscToolTip = "Ascending" OnItemDataBound="GridItemDataBound" 
            SortingSettings-SortedDescToolTip="Descending" GridLines="None"   
            Skin="Web20">  
            <PagerStyle Mode="NextPrevAndNumeric" ></PagerStyle>  
            <MasterTableView  
                AutoGenerateColumns="false"   
                AllowSorting="false" GroupLoadMode="Client" 
                AllowCustomSorting="true"   
                AllowMultiColumnSorting="true"   
                ClientDataKeyNames="Reference" 
                DataKeyNames="Reference" AllowNaturalSort="False">  
                <GroupByExpressions> 
                    <telerik:GridGroupByExpression> 
                        <SelectFields> 
                            <telerik:GridGroupByField FieldName="Year" />                             
                        </SelectFields> 
                        <GroupByFields> 
                            <telerik:GridGroupByField FieldName="Year" SortOrder="Descending"/>                           
                        </GroupByFields> 
                    </telerik:GridGroupByExpression> 
                    <telerik:GridGroupByExpression> 
                        <SelectFields> 
                            <telerik:GridGroupByField FieldName="Author" />                           
                        </SelectFields> 
                        <GroupByFields> 
                            <telerik:GridGroupByField FieldName="Author" SortOrder="Ascending"/>                              
                        </GroupByFields> 
                    </telerik:GridGroupByExpression> 
                </GroupByExpressions> 
                <Columns> 
                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">  
                        <HeaderStyle Width="32px" /> 
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridHyperLinkColumn UniqueName="TitleColumn" DataTextField="Title" HeaderText="Title" DataNavigateUrlFields="Reference"></telerik:GridHyperLinkColumn> 
                    <telerik:GridBoundColumn UniqueName="AuthorColumn" DataField="AUTHOR" HeaderText="Author" /> 
                    <telerik:GridBoundColumn UniqueName="DateColumn" DataField="DATE" HeaderText="Date" /> 
                    <telerik:GridHyperLinkColumn UniqueName="RelatedColumn" Text="Related..." DataNavigateUrlFields="Related"></telerik:GridHyperLinkColumn> 
                </Columns> 
                <NestedViewSettings> 
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="Reference" MasterKeyField="Reference" /> 
                    </ParentTableRelation> 
                </NestedViewSettings> 
                <NestedViewTemplate> 
                <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">  
                    <div class="contactWrap">  
                        <fieldset style="padding: 10px;">  
                            <legend style="padding: 5px;"><b>Detail info for document:&nbsp; &nbsp;<%#Eval("Title") %></b>  
                            </legend> 
                            <table> 
                                <tbody> 
                                    <tr> 
                                        <td> 
                                            <table> 
                                                <tbody> 
                                                    <tr> 
                                                        <td> 
                                                            Reference:  
                                                        </td> 
                                                        <td> 
                                                            <%#Eval("reference") %> 
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td> 
                                                            Location:  
                                                        </td> 
                                                        <td> 
                                                            <%#Eval("LOCATION") %> 
                                                        </td> 
                                                    </tr> 
 
                                                </tbody> 
                                            </table> 
                                        </td> 
                                    </tr> 
                                </tbody> 
                            </table> 
                        </fieldset> 
                    </div> 
                </asp:Panel> 
                </NestedViewTemplate> 
                <NoRecordsTemplate> 
                    No Results Found  
                </NoRecordsTemplate> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" AllowGroupExpandCollapse="true" > 
                <Resizing AllowColumnResize="true" EnableRealTimeResize="true" /> 
                <Selecting AllowRowSelect="true"></Selecting> 
            </ClientSettings> 
            <SortingSettings EnableSkinSortStyles="False" SortedAscToolTip="Ascending"   
                SortedDescToolTip="Descending" /> 
        </telerik:RadGrid> 
 
        <div class="searchMsgDiv">  
            <asp:Label ID="MessageLabel" runat="server" EnableViewState="false" Visible="false" /> 
        </div> 
    </asp:Panel> 
</div> 

 

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 10 Feb 2010, 03:51 PM
Hi Gridiron,

Could you please try to set the MasterTableView.HierarchyLoadMode property to Client and let me know if the issue still persists:

<MasterTableView HierarchyLoadMode="Client" AutoGenerateColumns="false" AllowSorting="false">

Also it will be helpful if you could send us a simple project that could be used for reproducing the problem. Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer. You could open a formal support ticket from your Telerik account and attach a ZIP file there.

Additionally I am sending you a simple example that illustrates how to perform grouping in the RadGrid with NestedViewTemplate.

I hope this helps.

Sincerely yours,
Radoslav
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
gridiron
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or