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

RadGrid - group header not displaying properly

2 Answers 166 Views
Grid
This is a migrated thread and some comments may be shown as answers.
madhavi
Top achievements
Rank 1
madhavi asked on 29 Sep 2017, 05:49 PM

Hi,

      I am having trouble in displaying group header correctly in RadGrid. Most of the group headers are displaying fine, but few not. I am not able to figure it out, what is causing that issue. Below are my grid and group settings. I am also attaching the grid screenshot for reference. Any suggestions please, what I am doing wrong.

Thank you, Madhavi

                    <t:RadGrid ID="rgLEV" runat="server"
                                    AllowSorting="True" GridLines="None" ShowFooter="True" AutoGenerateColumns="false" EnableViewState = "true"
                                    GroupingEnabled="true" ShowGroupPanel="true" OnGroupsChanging="rgLEV_GroupsChanging" AllowMultiRowSelection="true"  
                                    HeaderStyle-Wrap="false" ItemStyle-Wrap="false" GroupingSettings-GroupByFieldsSeparator=""                                   
                                    OnNeedDataSource="rgLEV_NeedDataSource"
                                    OnPreRender="rgLEV_PreRender"
                                    OnItemCommand="rgLEV_ItemCommand"
                                    OnUpdateCommand="rgLEV_UpdateCommand"
                                    OnItemCreated="rgLEV_ItemCreated" 
                                    OnDetailTableDataBind="rgLEV_DetailTableDataBind"
                                    OnItemDataBound="rgLEV_ItemDataBound"
                                    OnExportCellFormatting="rgLEV_ExportCellFormatting">

                        <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" 
                                ReorderColumnsOnClient="True">  
                                <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />    
                        </ClientSettings>

                     <GroupingSettings RetainGroupFootersVisibility="true"/>

                    <GroupByExpressions>
                            <t:GridGroupByExpression>
                              
                                <SelectFields>
                                    <t:GridGroupByField FieldName="EMP_NAME_LINE" HeaderValueSeparator="" HeaderText=" " />
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField FieldName="EMPLOYEE_ID" FormatString="({0})" HeaderValueSeparator="" HeaderText="&nbsp;"/>
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="WORKED_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;Hours" />
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="LD_POT_OT_HOURS"  HeaderText="&nbsp;&nbsp;&nbsp;OT" />
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="LD_POT_DT_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;DT" />
                                </SelectFields>
                                  <GroupByFields>
                                    <t:GridGroupByField FieldName="EMP_NAME_LINE" />
                                </GroupByFields>
                            </t:GridGroupByExpression>
                                    
                            <t:GridGroupByExpression>                         
                                <SelectFields>
                                    <t:GridGroupByField FieldName="WORKED_DT" FormatString="{0:MM/dd/yyyy}" HeaderText="Date" />
                                </SelectFields>
                                    <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="WORKED_HOURS"  HeaderText="&nbsp;&nbsp;&nbsp;Hours" />
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="OT_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;OT" />
                                </SelectFields>
                                <SelectFields>
                                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="DT_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;DT" />
                                </SelectFields>
                                <GroupByFields>
                                    <t:GridGroupByField FieldName="WORKED_DT" />
                                </GroupByFields>
                            </t:GridGroupByExpression>
                        </GroupByExpressions>

2 Answers, 1 is accepted

Sort by
0
madhavi
Top achievements
Rank 1
answered on 29 Sep 2017, 09:17 PM

I want to add one more issue to this problem. If I add third group level to the grid, all that level group headers don't show totals at all. Attaching the screenshot for reference. 

 <t:GridGroupByExpression>
            <GroupByFields>
                 <t:GridGroupByField FieldName="PAY_TYPE_CODE"/>
             </GroupByFields>
             <SelectFields>
                  <t:GridGroupByField FieldName="PAY_TYPE_CODE"  HeaderText="Pay" />
             </SelectFields>
              <SelectFields>
                  <t:GridGroupByField Aggregate="SUM" FormatString="{0:F2}" FieldName="WORKED_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;Hours" />
               </SelectFields>
                <SelectFields>
                    <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="OT_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;OT" />
                 </SelectFields>
                  <SelectFields>
                        <t:GridGroupByField Aggregate="Sum" FormatString="{0:F2}" FieldName="DT_HOURS" HeaderText="&nbsp;&nbsp;&nbsp;DT" />
                  </SelectFields>
                   <SelectFields>
                        <t:GridGroupByField Aggregate="Sum"  FormatString="{0:F2}" FieldName="ASSIGNED_DOLLARS" HeaderText="&nbsp;&nbsp;&nbsp;Dollars:$" />
                   </SelectFields>

</t:GroupGroupByExpression>

0
madhavi
Top achievements
Rank 1
answered on 03 Oct 2017, 09:14 PM

Able to figure it out, why only that particular record header was not displaying with values. There was extra space for that employee name field, which is causing distortion to the header.

Any ideas, why the header is not displaying any values, when we add 3rd group level to the grid. Or could it be a bug in telerik. Please advice.

- Thank you

Tags
Grid
Asked by
madhavi
Top achievements
Rank 1
Answers by
madhavi
Top achievements
Rank 1
Share this question
or