Hi,
I have added the "GridCalculatedColumn" in rad grid. where there are items in the grid, the calculated column is working fine. However when there are no items in grid, the gridcalculated column is giving the error as "operator * cannot be applied between string and string.".
Below is the code i have:
How to modify the code to use when the grid has no items?
Thanks
I have added the "GridCalculatedColumn" in rad grid. where there are items in the grid, the calculated column is working fine. However when there are no items in grid, the gridcalculated column is giving the error as "operator * cannot be applied between string and string.".
Below is the code i have:
<
telerik:GridTemplateColumn
DataField
=
"OrderQuantity"
HeaderText
=
"Order Quantity"
UniqueName
=
"OrderQuantity"
Visible
=
"true"
>
<
InsertItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadtxtOrderQuantity"
runat
=
"server"
Text
=
""
>
</
telerik:RadTextBox
>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadtxtOrderQuantity"
runat
=
"server"
Text='<%# Eval("OrderQuantity") %>'>
</
telerik:RadTextBox
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadtxtOrderQuantity"
ReadOnly
=
"true"
runat
=
"server"
Text='<%# Eval("OrderQuantity") %>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"UnitPrice"
HeaderText
=
"Unit Price"
UniqueName
=
"UnitPrice"
Visible
=
"true"
>
<
InsertItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"RadtxtUnitPrice"
runat
=
"server"
>
</
telerik:RadNumericTextBox
>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"RadtxtUnitPrice"
runat
=
"server"
Text='<%# Eval("UnitPrice") %>'>
</
telerik:RadNumericTextBox
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"RadtxtUnitPrice"
Type
=
"Currency"
ReadOnly
=
"true"
runat
=
"server"
Text='<%# Eval("UnitPrice") %>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridCalculatedColumn
DataFormatString
=
"{0:C}"
DataType
=
"System.Double"
HeaderText
=
"Extended Price"
UniqueName
=
"ExtendedPrice"
DataFields
=
"OrderQuantity,UnitPrice"
Expression
=
"{0}*{1}"
FooterText
=
"Total : "
Aggregate
=
"Sum"
>
</
telerik:GridCalculatedColumn
>
How to modify the code to use when the grid has no items?
Thanks