Hi there,
I have a gridview with two columns - CAD Amount and USD Amount - that I hide/display based on a radiobutton choice. In the grid, when a user groups by another column Employee, I display the sum of the CAD Amount and USD Amount in the group header. Currently, both aggregate values are displayed even if only one of the CAD Amount or USD Amount columns is visible. However, I would only like to display the sum for the column in the header if the column is visible. Is this possible?
Here is the XAML code:
Thanks,
Amy
I have a gridview with two columns - CAD Amount and USD Amount - that I hide/display based on a radiobutton choice. In the grid, when a user groups by another column Employee, I display the sum of the CAD Amount and USD Amount in the group header. Currently, both aggregate values are displayed even if only one of the CAD Amount or USD Amount columns is visible. However, I would only like to display the sum for the column in the header if the column is visible. Is this possible?
Here is the XAML code:
<
telerik:RadGridView
x:Name
=
"CostDetailsGridView"
Width
=
"594"
Height
=
"370"
IsReadOnly
=
"True"
AutoGenerateColumns
=
"False"
ShowColumnFooters
=
"True"
ShowGroupFooters
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding PostingDate}"
DataFormatString
=
"{}{0:d}"
Header
=
"Posting Date"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding AmountCAD}"
Header
=
"Amount (in CA$)"
TextAlignment
=
"Right"
FooterTextAlignment
=
"Right"
DataFormatString
=
"{}{0:c0}"
IsGroupable
=
"False"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
SourceField
=
"AmountCAD"
ResultFormatString
=
"{}{0:c0}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding AmountUSD}"
Header
=
"Amount (in US$)"
TextAlignment
=
"Right"
FooterTextAlignment
=
"Right"
DataFormatString
=
"{}{0:c0}"
IsGroupable
=
"False"
IsVisible
=
"False"
>
<
telerik:GridViewDataColumn.AggregateFunctions
>
<
telerik:SumFunction
SourceField
=
"AmountUSD"
ResultFormatString
=
"{}{0:c0}"
/>
</
telerik:GridViewDataColumn.AggregateFunctions
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Employee}"
Header
=
"Employee"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Department}"
Header
=
"Department"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Reimbursement}"
Header
=
"Reimbursement"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ExpenseType}"
Header
=
"Expense Type"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.GroupDescriptors
>
<
telerik:GroupDescriptor
Member
=
"Employee"
DisplayContent
=
"Employee"
SortDirection
=
"Ascending"
/>
</
telerik:RadGridView.GroupDescriptors
>
</
telerik:RadGridView
>
Thanks,
Amy