
prayag ganoje
Top achievements
Rank 1
prayag ganoje
asked on 27 Apr 2011, 11:27 PM
Hello,
I am using radgrid control in which I had done the same has displayed in your demo. Here I wish add one more functionality.
I want to display total count of cases and aging in header. Please see attached image.
In front of text CHINA I want to display cases as 4 and aging is average of those two values. I am not very sure how I can perform that ?
Can you please suggest how i can get those values there in header ?
P.N.:- I don't want those values in footer.
I am using radgrid control in which I had done the same has displayed in your demo. Here I wish add one more functionality.
I want to display total count of cases and aging in header. Please see attached image.
In front of text CHINA I want to display cases as 4 and aging is average of those two values. I am not very sure how I can perform that ?
Can you please suggest how i can get those values there in header ?
P.N.:- I don't want those values in footer.
4 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 28 Apr 2011, 05:55 AM
Hello Prayag,
You can perform calculations in group header by attaching ItemDataBound event to your RadGrid. This documentation shows how to calculate average and adds this calculated value to the DataCell.Text property of the grid header item. Check out this documentation for more details.
Performing calculations in group header.
Thanks,
Princy,
You can perform calculations in group header by attaching ItemDataBound event to your RadGrid. This documentation shows how to calculate average and adds this calculated value to the DataCell.Text property of the grid header item. Check out this documentation for more details.
Performing calculations in group header.
Thanks,
Princy,
0

prayag ganoje
Top achievements
Rank 1
answered on 04 May 2011, 10:36 PM
Hello,
I have a grid as below but there are few queries:
Please see resulting group header.
1 need only values. no header text is required.
2. these groupheader values need to be in respective columns and not to be placed after one another.
3. Sum and avg should be only 1 decimal precision and should be rounded
I have a grid as below but there are few queries:
<
telerik:RadGrid
ID
=
"rg_CSMD_Backlog_By_Status_FL"
runat
=
"server"
AllowPaging
=
"false"
PageSize
=
"15"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
OnNeedDataSource
=
"rg_CSMD_Backlog_By_Status_FL_NeedDataSource"
BorderColor
=
"White"
BorderStyle
=
"None"
Height
=
"99.9%"
Width
=
"99.9%"
OnItemDataBound
=
"rg_CSMD_Backlog_By_Status_FL_ItemDataBound"
OnItemCommand
=
"rg_CSMD_Backlog_By_Status_FL_ItemCommand"
ShowGroupPanel
=
"false"
ShowFooter
=
"false"
>
<
MasterTableView
CommandItemDisplay
=
"None"
DataKeyNames
=
"OWNER"
GroupLoadMode
=
"Client"
GroupsDefaultExpanded
=
"false"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"GroupBy"
HeaderText
=
""
FormatString
=
""
FieldName
=
"GroupBy"
/>
<
telerik:GridGroupByField
FieldAlias
=
"CASES"
Aggregate
=
"Sum"
HeaderText
=
""
FormatString
=
""
FieldName
=
"CASES"
/>
<
telerik:GridGroupByField
FieldAlias
=
"AGING"
Aggregate
=
"Avg"
HeaderText
=
""
FormatString
=
""
FieldName
=
"AGING"
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"GroupBy"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"OWNER"
HeaderText
=
"OWNER"
DataFormatString="<nobr>{0}</
nobr
>"
HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="X-Small" HeaderStyle-Width="50%">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CASES"
HeaderText
=
"CASES"
DataFormatString="<nobr>{0}</
nobr
>"
HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="X-Small">
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AGING"
HeaderText
=
"AGING"
DataFormatString="<nobr>{0}</
nobr
>"
HeaderStyle-Font-Bold="true" HeaderStyle-Font-Size="X-Small">
</
telerik:GridBoundColumn
>
</
Columns
>
<
PagerStyle
Mode
=
"NextPrev"
></
PagerStyle
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
AllowGroupExpandCollapse
=
"true"
>
<
Resizing
AllowColumnResize
=
"true"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Scrolling
AllowScroll
=
"false"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Please see resulting group header.
1 need only values. no header text is required.
2. these groupheader values need to be in respective columns and not to be placed after one another.
3. Sum and avg should be only 1 decimal precision and should be rounded
0

Princy
Top achievements
Rank 2
answered on 05 May 2011, 06:43 AM
Hello Prayag,
Check the following documentation which deals with aligning items in the GroupHeader of the grid.
Aligning items in GroupHeader.
Also refer the help article which deals with formatting of the group header using the grid's ItemDataBound event
Customizing GridGroupHeaderItem
In order to achieve 1 decimal precision, try the following.
decimal a = 1.994444M;
Math.Round(a, 1);
Thanks,
Princy.
Check the following documentation which deals with aligning items in the GroupHeader of the grid.
Aligning items in GroupHeader.
Also refer the help article which deals with formatting of the group header using the grid's ItemDataBound event
Customizing GridGroupHeaderItem
In order to achieve 1 decimal precision, try the following.
decimal a = 1.994444M;
Math.Round(a, 1);
Thanks,
Princy.
0

prayag ganoje
Top achievements
Rank 1
answered on 05 May 2011, 12:57 PM