Hello!
I'm trying to use GridCalculatedColumn in order to show concatenated and formatted values.
I need to show StartTime and EndTime as 08:45 AM - 01:45 PM
Similarly, Rate and RatePlus as £15.50 + £14.00
Successfully doing this will help me eliminate two/four columns. However, formatting is utmost necessary. My web applications culture is set to UK in web.config. The data source being fed to the grid is coming through LINQ -> DataTable -> Grid. Commenting these two GridCalculatedColumn makes everything run just fine. However, with these two columns, I get the following error upon Databind():
I have confirmed that no null value is present in the result of the query.
Any help will be highly appreciated.
Regards.
I'm trying to use GridCalculatedColumn in order to show concatenated and formatted values.
I need to show StartTime and EndTime as 08:45 AM - 01:45 PM
Similarly, Rate and RatePlus as £15.50 + £14.00
Successfully doing this will help me eliminate two/four columns. However, formatting is utmost necessary. My web applications culture is set to UK in web.config. The data source being fed to the grid is coming through LINQ -> DataTable -> Grid. Commenting these two GridCalculatedColumn makes everything run just fine. However, with these two columns, I get the following error upon Databind():
Expression of type 'System.Nullable`1[System.DateTime]'
cannot be used for parameter of type 'System.Object'
of method 'System.String Concat(System.Object, System.Object)'
I have confirmed that no null value is present in the result of the query.
<
telerik:GridCalculatedColumn
UniqueName
=
"Timings"
HeaderText
=
"Timings"
DataType
=
"System.DateTime"
DataFields
=
"StartTime, EndTime"
Expression
=
'{0} + " " + "-" + "; " + {1}'
DataFormatString
=
"{0:hh:mm tt}"
/>
<
telerik:GridCalculatedColumn
UniqueName
=
"Rates"
HeaderText
=
"Rates"
DataType
=
"System.Decimal"
DataFields
=
"Rate, RatePlus"
Expression
=
'{0} + " " + "+" + "; " + {1}'
DataFormatString
=
"{0:C2}"
/>
Any help will be highly appreciated.
Regards.