Right now, I have two GridBoundColumns pulling OfficePhone and Extension from a SQL database.
<
telerik:GridBoundColumn
HeaderText
=
"Phone"
DataField
=
"OfficePhone"
UniqueName
=
"OfficePhone"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderText
=
"Ext"
DataField
=
"Extension"
UniqueName
=
"Extension"
>
</
telerik:GridBoundColumn
>
I would like to combine the two columns into one, into something like this:
<
telerik:GridCalculatedColumn
HeaderText
=
"Phone"
UniqueName
=
"Phone"
DataType
=
"System.String"
DataFields
=
"OfficePhone, Extension"
Expression
=
"{0} + ' ext. ' + {1})"
>
</
telerik:GridCalculatedColumn
>
but extension is usually null or "", causing most of the cells to go blank.
Is there a way to set the expression programmatically, depending on whether there is a value for extension?