locked
Cannot get Telerik Radgrid to perform grouping RRS feed

  • Question

  • User-1355356054 posted

    I need to convert an SSRS report that I developed into a Telerik grid which does similiar grouping (see attached files).


    Notice that in the SSRS rpt, the data is grouped by CruiseLine, Ship, and Date. I want that same kind of grouping (not the look, just the correct grouping) in the Telerk Grid, but cannot achieve that desired result.


    I've read articles and searched the web about this topic. I've tried several different things, but I just can't get it to group data on those fields.
    The detail data is coming out fine (see attached file "telerik grp") with the correct display in the Group Header.


    I don't know where the top line (CruiseLine, Ship, and Date) comes from via my grid. I don't see any properties that would display that. I'm not interested in any sorting, just grouping. btw, when I click on any of those 3, the grid just disappears.

    Can somebody please help me achieve what should be, a simple grouping, and point out what I'm doing wrong that needs to be corrected?

    I just forgot that this forum doesn't accept attachments, so I can't show you any of the items previoulsy mentioned, unless someone can inform me of a way to upload the attachments.


    Below, is my code for the grid.

    <telerik:radgrid id="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="False" AllowPaging="True" ShowGroupPanel="True" 
                            ShowFooter="True" > 
                            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                            <MasterTableView GroupsDefaultExpanded="false" GroupLoadMode="Client" ShowGroupFooter="True" pagesize="50"
                                ExpandCollapseColumn-Groupable="True">
                                <RowIndicatorColumn Visible="True">  
                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                </RowIndicatorColumn> 
                                <ExpandCollapseColumn Visible="True">  
                                    <HeaderStyle Width="19px"></HeaderStyle> 
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="CruiseLine" ReadOnly="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Ship" ReadOnly="true">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Date" ReadOnly="true" DataFormatString="{0:M/d/yyyy}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product1Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product2Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product3Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product4Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product5Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Product6Cash" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Sales" ReadOnly="true" DataFormatString="{0:C2}">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <GroupByExpressions>
                                  <telerik:GridGroupByExpression>
                                    <SelectFields>
                                      <telerik:GridGroupByField FieldName="CruiseLine" />
                                      <telerik:GridGroupByField FieldName="Ship" />
                                      <telerik:GridGroupByField FieldName="Date" FormatString="{0:M/d/yyyy}" />
                                    </SelectFields>
                                    <GroupByFields>
                                      <telerik:GridGroupByField FieldName="CruiseLine" />
                                      <telerik:GridGroupByField FieldName="Ship" />
                                      <telerik:GridGroupByField FieldName="Date" FormatString="{0:M/d/yyyy}" />
                                    </GroupByFields>
                                  </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                            </MasterTableView>
                        </telerik:radgrid>
    Wednesday, January 23, 2013 11:56 AM

All replies

  • User1525433465 posted

    Hi,

    In order to implement advanced features in grid like grouping, sorting etc make sure that the grid is  binded with advanced data binding using its NeedDataSource event. Check the following help documentation which explains more about this.

    http://www.telerik.com/help/aspnet-ajax/grid-advanced-data-binding.html

    Thursday, January 24, 2013 2:44 AM
  • User304595673 posted
    Need to get up and running ASAP with Telerik Rad Grid for ASP.NET AJAX? http://www.tekkiebooks.com/book/ telerik_rad_grid_control_for_aspnet_ajax_by_full_example/aspnetforum1
    Thursday, September 19, 2013 2:26 PM
  • User-1233619993 posted

    what about this:

    ....
    <
    ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True"/>
    </telerik:RadGrid>

    Tuesday, February 11, 2014 1:00 PM