RadGrid GroupBy Problem

2 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    87 posts
    Member since:
    Oct 2012

    Posted 12 Jan 2011 Link to this post

    I am using a RadGrid and doing group by with jobstateName but when I bind the data my last stage comes first with users.
    I also don't want that in my header it appears that I am grouping my data with jobstatename because i don't want it to show to the end-user. Because jobstatename appears at the top of the grid and it looks very ugly in my scenario. Any help would be really appreciated.

    For example

    stage4
    john 
    harry

    stage3
    some users here ...

    stage2
    some users here ...

    stage1
    some users here ...


      <telerik:RadGrid ID="gvUserJobMapping" runat="server" PageSize="10" AllowSorting="True"
                GroupingEnabled="true" AllowPaging="True" ShowGroupPanel="True" AutoGenerateColumns="False"
                GridLines="None" CssClass="gridviewSpacing gvJobStates">
                <PagerStyle Mode="NumericPages"></PagerStyle>
                <MasterTableView Width="50%" GroupLoadMode="Client" TableLayout="Fixed">
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="JobStateName" FieldAlias="JobStateName" HeaderText="Job Stages"
                                    FormatString="{0:D}"></telerik:GridGroupByField>
                            </SelectFields>
    <GroupByFields>
       <telerik:GridGroupByField FieldName="JobStateName" FieldAlias="JobStateName"
           HeaderText="Job Stages" SortOrder="Ascending">
       </telerik:GridGroupByField>
    </GroupByFields>            
            </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="JobID" HeaderText="JobID" HeaderButtonType="TextButton"
                            DataField="JobID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="JobStateID" HeaderText="JobStateID" HeaderButtonType="TextButton"
                            DataField="JobStateID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="JobID" HeaderText="JobID" HeaderButtonType="TextButton"
                            DataField="JobID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="UserID" HeaderText="UserID" HeaderButtonType="TextButton"
                            DataField="UserID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="RoleID" HeaderText="RoleID" HeaderButtonType="TextButton"
                            DataField="RoleID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="UserName" HeaderText="User Name" HeaderButtonType="TextButton"
                            DataField="UserName">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkSendEmail" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="True" AllowDragToGroup="False"
                    AllowColumnsReorder="True">
                </ClientSettings>
            </telerik:RadGrid>




  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 17 Jan 2011 Link to this post

    Hello Muhammad,

    To implement the described functionality, please use the approach from this help topic in order to set the text of the DataCell of the GridGroupHeaderItem to the desired value.

    I hope this helps.

    Best wishes,
    Mira
    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.
Back to Top