Hi,
I am having a problem achieving what I want to with the WPF RadGridView and the DataFormatString property. I have a grid with various numeric values and need to set the format of these values at a row level as opposed to a column level. It has not been possible to bind the DataFormatString to a property of the row data item.
I have tried to use control templates both declarative and programmatic with template selector but the performance is not good compared with the standard GridViewDataColumn implementation.
Is there any way that I can bind to this property or any other suggestions as to how I achieve the requirement of formatting the data of a cell based a property of the row dataitem.
To explain a little further here is my object:
And the GridView would look something like:
Thanks
Oliver
I am having a problem achieving what I want to with the WPF RadGridView and the DataFormatString property. I have a grid with various numeric values and need to set the format of these values at a row level as opposed to a column level. It has not been possible to bind the DataFormatString to a property of the row data item.
I have tried to use control templates both declarative and programmatic with template selector but the performance is not good compared with the standard GridViewDataColumn implementation.
Is there any way that I can bind to this property or any other suggestions as to how I achieve the requirement of formatting the data of a cell based a property of the row dataitem.
To explain a little further here is my object:
public
class
PlanningItem
{
public
string
ItemName {
get
;
set
; }
public
string
ItemFormat {
get
;
set
; }
public
double
ItemValue {
get
;
set
; }
}
And the GridView would look something like:
<
telerik:RadGridView
AutoGenerateColumns
=
"False"
Name
=
"radGridView1"
ItemsSource
=
"{ Binding Path=PlanningItems }"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemName"
Header
=
"Item Name"
DataMemberBinding
=
"{ Binding Path=ItemName }"
IsReadOnly
=
"True"
/>
<
telerik:GridViewDataColumn
UniqueName
=
"ItemValue"
Header
=
"Item Value"
DataMemberBinding
=
"{ Binding Path=ItemValue}"
DataFormatString
=
"{ Binding ItemFormat }"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
Thanks
Oliver