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

Group collapses, but will not expand.

5 Answers 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 2
Gary asked on 28 Jan 2010, 04:21 AM

I have a RadGrid with the default setting of GroupLoadMode="Server".   When I click on a group, it collapses, but when I click on it again, it will not expand.  Am I missing some setting?

    <telerik:RadGrid ID="rgContacts" runat="server"   
        AllowSorting="True"   
        AllowFilteringByColumn="True"   
        AllowPaging="True" 
        EnableEmbeddedSkins="False" 
        EnableViewState="false" 
        GridLines="None"   
        PageSize="20" 
        Skin="IBMS" 
        ShowGroupPanel="True" 
        onprerender="rgContacts_PreRender" 
        oncolumncreated="rgContacts_ColumnCreated"   
        onitemdatabound="rgContacts_ItemDataBound"   
        OnItemCreated="rgContacts_ItemCreated" 
        OnNeedDataSource="rgContacts_NeedDataSource" 
        > 
          
        <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" /> 
 
        <ClientSettings   
            ReorderColumnsOnClient="True"   
            AllowDragToGroup="True"   
            AllowColumnsReorder="True" 
            >  
            <Scrolling   
                AllowScroll="True"   
                UseStaticHeaders="True"   
                FrozenColumnsCount="1"    
                EnableVirtualScrollPaging="false">  
            </Scrolling> 
            <Resizing   
                AllowRowResize="False"   
                AllowColumnResize="True">  
            </Resizing> 
        </ClientSettings> 
                          
        <HeaderContextMenu EnableEmbeddedSkins="False"></HeaderContextMenu> 
          
        <MasterTableView AllowMultiColumnSorting="true" CommandItemDisplay="Top" AutoGenerateColumns="false" GroupLoadMode="Server">  
              
            <CommandItemTemplate> 
                <div style="padding: 2px 2px;">  
                    <table width="100%">  
                        <tr> 
                            <td> 
                            <uc1:wucToolbarSave ID="wucToolbarSave" runat="server"   
                                                    OnToolbarSaveClick="ToolbarSave_Click" DisplayToolbar="true" 
                                                    VisibleView="false" VisibleCancel="false" VisibleDelete="false" VisibleEdit="false"                                                      VisibleReturn="false" VisibleSave="false" ViewAdd="true" ViewItem="true"/>  
                            </td> 
                            <td align="right">  
                                <uc2:wucToolbarGridSettings ID="wucToolbarGridSettings" runat="server" />                                                            </td> 
                        </tr> 
                    </table> 
                </div>   
            </CommandItemTemplate> 
 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
              
            <Columns> 
                <telerik:GridTemplateColumn UniqueName="ViewCommand"   
                    AllowFiltering="false" Resizable="false" Reorderable="false"   
                    HeaderStyle-Width="36" ItemStyle-Width="36">  
                    <ItemTemplate> 
                        <asp:HyperLink ID="hlView" runat="server" NavigateUrl='<%# "~/ContactManagement/Contact" + Eval("PartyType") + ".aspx?id=" + Eval("PartyId") %>'>  
                            <asp:Image ID="imgView" runat="server" ToolTip='View Contact' ImageUrl='<%# "~/App_Themes/Standard/images/view.png" %>' /> 
                        </asp:HyperLink> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                  
                <telerik:GridTemplateColumn UniqueName="PartyType" DataField="PartyType" SortExpression="PartyType" GroupByExpression="PartyType Group By PartyType" 
                     AllowFiltering="false" Resizable="false" Reorderable="true" Groupable="true"   
                    HeaderStyle-Width="48" ItemStyle-Width="48"  ItemStyle-HorizontalAlign="Center" HeaderText="Type">  
                    <ItemTemplate> 
                        <asp:Image ID="imgType" runat="server" ToolTip='<%# Eval("PartyType") %>' ImageUrl='<%# "~/App_Themes/Standard/images/" + Eval("PartyType") + ".png" %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>     
                  
                <telerik:GridBoundColumn DataField="Code" Groupable="true"   
                    HeaderText="Code" SortExpression="Code" UniqueName="Code">  
                </telerik:GridBoundColumn> 
                               
                <telerik:GridBoundColumn DataField="Contact" Groupable="true"   
                    HeaderText="Contact" SortExpression="Contact" UniqueName="Contact">  
                </telerik:GridBoundColumn> 
 
                <telerik:GridBoundColumn DataField="Business_PhoneNumber" Groupable="true"   
                    HeaderText="Business Phone" SortExpression="Business_PhoneNumber" UniqueName="Business_PhoneNumber">  
                </telerik:GridBoundColumn> 
 
                <telerik:GridBoundColumn DataField="Business_CellNumber" Groupable="true"   
                    HeaderText="Business Cell" SortExpression="Business_CellNumber" UniqueName="Business_CellNumber">  
                </telerik:GridBoundColumn> 
                  
                <telerik:GridBoundColumn DataField="Business_Email" Groupable="true"   
                    HeaderText="Business Email" SortExpression="Business_Email" UniqueName="Business_Email">  
                </telerik:GridBoundColumn> 
                  
                <telerik:GridTemplateColumn DataField="Business_Address" Groupable="true"   
                    HeaderText="Business Address" SortExpression="Business_Address" UniqueName="Business_Address">  
                    <ItemTemplate> 
                        <asp:Literal ID="lblDisplayAs" runat="server" Text='<%# ConvertToHTML(Eval("Business_Address")) %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
 
                <telerik:GridBoundColumn DataField="Organization_Type" Groupable="true"   
                    HeaderText="Organization Type" SortExpression="Organization_Type" UniqueName="Organization_Type">  
                </telerik:GridBoundColumn> 
                  
            </Columns> 
                  
            <GroupByExpressions> 
                <telerik:GridGroupByExpression> 
                    <SelectFields> 
                        <telerik:GridGroupByField FieldName="PartyType" HeaderText="Type" FormatString="{0}" /> 
                    </SelectFields> 
                    <GroupByFields> 
                        <telerik:GridGroupByField FieldName="PartyType" HeaderText="Type" SortOrder="Descending" /> 
                    </GroupByFields> 
                </telerik:GridGroupByExpression> 
            </GroupByExpressions> 
             
        </MasterTableView> 
          
        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" AllowGroupExpandCollapse="true">  
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
 
        <FilterMenu EnableEmbeddedSkins="False"></FilterMenu> 
     
    </telerik:RadGrid> 
 

5 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 28 Jan 2010, 07:26 AM
Hello Gray,

It seems that you have set the EnableViewState property of the grid to false. RadGrid does not manage grouping states when its ViewState is disabled. Refer to the following help article for more information on this:
Optimizing ViewState usage

If you need to use grouping in RadGrid, you would have to ViewState should be enabled.

Thanks
Princy.
0
Anthony
Top achievements
Rank 1
answered on 08 Apr 2011, 11:36 AM
Hi Hope you can help, i am having exactly the same problem as stated by Gary, my Grid will collapse but wont expand, ViewState is True and i have read the associated link but cannot see what i am missing.

My Grid is defined as follows :
<telerik:RadGrid ID="GridAwaitingAction" runat="server" Skin="WebBlue" AllowPaging="True"
    AllowSorting="True" Culture="en-GB" GridLines="None" 
    EnableLinqExpressions="true" AllowFilteringByColumn="True" Width="100%" EnableViewState="True">
    <GroupingSettings GroupByFieldsSeparator=";" />
    <ClientSettings AllowGroupExpandCollapse="true">
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowClick="RowClick" />
    </ClientSettings>
    <MasterTableView DataKeyNames="WSARecordID" Width="100%" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldAlias="Status" FieldName="Status"></telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldAlias="Status" FieldName="Status"></telerik:GridGroupByField>
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <CommandItemSettings ExportToPdfText="Export to Pdf" />
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
           
            <telerik:GridButtonColumn CommandName="ViewWSA" 
                ImageUrl="~/App_Themes/Merlin/Images/410.png" Text="Preview Report" UniqueName="ViewWSA">
            </telerik:GridButtonColumn>
           
        </Columns>
    </MasterTableView>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_WebBlue" 
        EnableImageSprites="True">
    </HeaderContextMenu>
</telerik:RadGrid>

Please help
0
Vasil
Telerik team
answered on 14 Apr 2011, 07:30 AM
Hello Anthony,

You are using the default GroupLoadMode which is server. And the same time you have set <ClientSettings AllowGroupExpandCollapse="true">

Try to set <ClientSettings AllowGroupExpandCollapse="false"> or <MasterTableView GroupLoadMode="Client"> and see if this solves the problem.

Do you get any JavaScript error when you click on the expand button? Is postback happening?

Greetings,
Vasil
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Anthony
Top achievements
Rank 1
answered on 14 Apr 2011, 08:53 AM
Hi Vasil

Thanks for the reply, setting <ClientSettings AllowGroupExpandCollapse="false"> and <MasterTableView GroupLoadMode="Client"> has resolved the issue.

Thanks for the help.

Tony
0
Rakesh
Top achievements
Rank 1
answered on 02 Jan 2014, 09:19 AM
Thanks a lot Anthony Adding GroupLoadMode="Client" resolved my issue. 
Tags
Grid
Asked by
Gary
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Anthony
Top achievements
Rank 1
Vasil
Telerik team
Rakesh
Top achievements
Rank 1
Share this question
or