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

RadGrid GroupBy Problem

1 Answer 40 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 12 Jan 2011, 11:53 AM
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>




1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 17 Jan 2011, 01:23 PM
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.
Tags
TreeView
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or