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

[Solved] Groups Not Collapsing When Clicked

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 20 Apr 2009, 02:10 PM
Hi Everyone,

We are using a RadGrid and have implemented a GroupByExpressions code block to group our data by day. The grid properly groups and sorts the data based on the parameters we set, but when you click on the "down facing" arrow to collapse a given section, nothing happens.

We removed all update panels encapsulating the grid and we noticed that the grid produces a PostBack when the arrow is clicked, but nothing happens. We also tried adding a RadAjaxManager and RadAjaxLoadingPanel as seen in the RadGrid grouping demo.

Any help you can provide on this matter is greatly appreciated. Our code is below.

Thanks.

Code:

<Telerik:RadGrid  
    ID="trgGrid"  
    runat="server"  
    DataSourceID="dsSource"  
    AutoGenerateColumns="False"  
    GridLines="None"  
    Skin="Hay"
 
    <MasterTableView DataSourceID="dsSource"
    <RowIndicatorColumn Visible="False"
    <HeaderStyle Width="20px"></HeaderStyle> 
    </RowIndicatorColumn> 
 
    <ExpandCollapseColumn Visible="False" Resizable="False"
    <HeaderStyle Width="20px"></HeaderStyle> 
    </ExpandCollapseColumn> 
        <GroupByExpressions> 
            <Telerik:GridGroupByExpression> 
                <SelectFields> 
                    <Telerik:GridGroupByField 
                        FieldAlias="Date"  
                        FieldName="StartDateOnly"  
                        HeaderValueSeparator=": "  
                        FormatString="{0:D}"  
                    /> 
                </SelectFields> 
                <GroupByFields> 
                    <Telerik:GridGroupByField  
                        FieldName="StartDateOnly"  
                        SortOrder="Descending"  
                    /> 
                </GroupByFields> 
            </Telerik:GridGroupByExpression> 
        </GroupByExpressions> 
        <Columns> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn"
                <ItemTemplate> 
                  <asp:LinkButton ID="btn" runat="server" 
                    CommandName="myCommand" 
                    Text="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_btn_Text %>" 
                    CausesValidation="false" 
                  /> 
                </ItemTemplate> 
            </Telerik:GridTemplateColumn> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn2" HeaderText="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_colRange_Text %>"
                <ItemTemplate> 
                  <%# Eval("Range") %> 
                </ItemTemplate>             
            </Telerik:GridTemplateColumn> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn3" HeaderText="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_colName_Text %>"
                <ItemTemplate> 
                  <%# Eval("Name") %> 
                </ItemTemplate>             
            </Telerik:GridTemplateColumn> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn4" HeaderText="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_colType_Text %>"
                <ItemTemplate> 
                    <%# Eval("Type") %> 
                </ItemTemplate> 
            </Telerik:GridTemplateColumn> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn5" HeaderText="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_colTitle_Text %>"
                <ItemTemplate> 
                    <%# Eval("Title") %> 
                </ItemTemplate> 
            </Telerik:GridTemplateColumn> 
            <Telerik:GridTemplateColumn UniqueName="TemplateColumn6" HeaderText="<%$Resources:ascx.TelerikReservationsGrid, trgGrid_colRemaining_Text %>"
                <ItemTemplate> 
                    <%# Eval("Remaining") %> 
                </ItemTemplate> 
            </Telerik:GridTemplateColumn>                         
        </Columns> 
 
    <EditFormSettings> 
    <PopUpSettings ScrollBars="None"></PopUpSettings> 
    </EditFormSettings> 
    </MasterTableView> 
</Telerik:RadGrid> 
<MyClass:MyDataSource ID="dsSource" runat="server" EnablePaging="true" /> 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 22 Apr 2009, 03:27 PM
Hi Jason,

I went through your code and was not able to find what have caused the unexpected behavior.
When you set the GroupByExpression property for a GridTemplateColumn instance, a common problem is that RadGrid cannot get the value from the header text for that column and display it in the GroupHeaderItem. In such cases you need to use the FieldAlias property.
Find more information about Group by expression in the following articles:
Help topic
Demo

Best wishes,

Pavlina

the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or