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

Second level group always expanding

1 Answer 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brent
Top achievements
Rank 1
Brent asked on 30 Nov 2011, 02:09 AM

Hello!

 

Setup:

  1. 2 levels of grouping using the GroupByExpressions collection of the MasterTableView within the declarative portion of a page
  2. MasterTableView.GroupLoadMode set to “Client”
  3. MasterTableView.GroupsDefaultExpanded set to “false”

 

When I expand any of the top/1st level groups, I am expecting that the child/2nd level groups are shown expanded/collapsed based on their Expanded property. Instead what happens is that the child/2nd level groups are all shown as expanded.

 

Is this behavior expected or is there a fix/workaround that you can provide?

 

Thanks in advance,

Brent

 

<tlr:RadGrid runat="server" ID="grdDoubleGroupings" AutoGenerateColumns="true" 
    AllowSorting="true" 
    OnNeedDataSource="grdDoubleGroupings_NeedDataSource"
>
    <MasterTableView 
        GroupLoadMode="Client" 
        AllowMultiColumnSorting="true" 
        AllowNaturalSort="false" 
        GroupsDefaultExpanded="false"
    >
        <GroupByExpressions>
            <tlr:GridGroupByExpression>
                <GroupByFields>
                    <tlr:GridGroupByField FieldName="Category" />
                </GroupByFields>
                <SelectFields>
                    <tlr:GridGroupByField FieldName="Category" />
                </SelectFields>
            </tlr:GridGroupByExpression
            <tlr:GridGroupByExpression>
                <GroupByFields>
                    <tlr:GridGroupByField FieldName="Subcategory" />
                </GroupByFields>
                <SelectFields>
                    <tlr:GridGroupByField FieldName="Category" />
                    <tlr:GridGroupByField FieldName="Subcategory" />
                </SelectFields>                 
            </tlr:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
</tlr:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Nov 2011, 06:15 AM
Hello Brent,

I tried the same scenario in the version 2011.2.712.35, but no avail. Here is the sample code.
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="true"
  <MasterTableView  GroupLoadMode="Client"    GroupsDefaultExpanded="false">
   <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <SelectFields>
                <telerik:GridGroupByField FieldName="FirstName"/>
             </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="FirstName" />
                 </GroupByFields>
         </telerik:GridGroupByExpression>
   </GroupByExpressions>
   <GroupByExpressions>
       <telerik:GridGroupByExpression>
          <SelectFields>
             <telerik:GridGroupByField FieldName="EmployeeID"   />
          </SelectFields>
          <GroupByFields>
              <telerik:GridGroupByField FieldName="EmployeeID" />
          </GroupByFields>
       </telerik:GridGroupByExpression>
   </GroupByExpressions>
</telerik:RadGrid>

-Shinu.
Tags
Grid
Asked by
Brent
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or