Hello,
I'm having problems to add Aggregate to a GridCalculatedColumn.
This is my code (due to space I'm only copying a part of it):
The error is:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.
If I write the same code in a bind column all works fine.
Regards
Jose
I'm having problems to add Aggregate to a GridCalculatedColumn.
This is my code (due to space I'm only copying a part of it):
<
telerik:GridTableView
runat
=
"server"
AllowSorting
=
"true"
DataKeyNames
=
"QuotationLineId"
Caption
=
"Quotation Lines"
Name
=
"QuotationLines"
PageSize
=
"10"
CommandItemDisplay
=
"Top"
AllowPaging
=
"true"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
AllowFilteringByColumn
=
"false"
ShowFooter
=
"True"
>
<
Columns
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
Reorderable
=
"False"
Resizable
=
"False"
ShowFilterIcon
=
"False"
ShowSortIcon
=
"False"
UniqueName
=
"EditButton"
ImageUrl
=
"~/Images/Edit.png"
CommandName
=
"Edit"
>
<
ItemStyle
Width
=
"20px"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
</
telerik:GridButtonColumn
>
<
telerik:GridBoundColumn
DataField
=
"QuotationLineId"
HeaderText
=
"Id"
UniqueName
=
"QuotationLineId"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Units"
DataField
=
"Units"
UniqueName
=
"Units"
ItemStyle-Width
=
"25px"
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:0.00}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Description"
DataField
=
"Description"
UniqueName
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Cost"
DataField
=
"Cost"
UniqueName
=
"Cost"
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:c}"
ItemStyle-Width
=
"65px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Price"
DataField
=
"Price"
UniqueName
=
"Price"
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:c}"
ItemStyle-Width
=
"65px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"TotalCost"
HeaderText
=
"Total Cost"
DataFields
=
"Units, Cost"
Expression
=
'{0}*{1}'
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:c}"
ItemStyle-Width
=
"65px"
Aggregate
=
"Sum"
FooterStyle-HorizontalAlign
=
"Right"
FooterAggregateFormatString
=
"{0:c}"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"TotalPrice"
HeaderText
=
"Total Price"
DataFields
=
"Units, Price"
Expression
=
'{0}*{1}'
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:c}"
ItemStyle-Width
=
"65px"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"Margin"
HeaderText
=
"Margin"
DataFields
=
"Cost, Price"
Expression
=
'1-({0}/{1})'
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
DataFormatString
=
"{0:0.00%}"
ItemStyle-Width
=
"25px"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
Reorderable
=
"False"
Resizable
=
"False"
ShowFilterIcon
=
"False"
ShowSortIcon
=
"False"
UniqueName
=
"DeleteButton"
ImageUrl
=
"~/Images/Delete.png"
CommandName
=
"Delete"
ConfirmDialogType
=
"RadWindow"
ConfirmText
=
"Are you sure you want to delete this record?"
ConfirmTitle
=
"Delete record..."
ConfirmDialogHeight
=
"130px"
>
<
ItemStyle
Width
=
"20px"
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
</
telerik:GridButtonColumn
>
</
Columns
>
</
telerik:GridTableView
>
The error is:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.
If I write the same code in a bind column all works fine.
Regards
Jose