I have a RadGridView containing 20+ columns, a couple of which are bound to Enum properties. Both row and column virtualization is turned on. When I scroll horizontally to bring the enum columns into view, I often get binding errors on the enum columns such as:
System.Windows.Data Error: 6 :
'StringFormat'
converter failed to convert value
'Cleared'
(type
'BookingStatus'
); fallback value will be used,
if
available. BindingExpression:Path=Value; DataItem=
'GridViewCell'
(Name=
''
); target element
is
'TextBlock'
(Name=
''
); target property
is
'Text'
(type
'String'
) FormatException:'System.FormatException: Format String can be only
"G"
,
"g"
,
"X"
,
"x"
,
"F"
,
"f"
,
"D"
or
"d"
.
at System.Enum.ToString(String format)
at System.Enum.ToString(String format, IFormatProvider provider)
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'
My cell template for the Enum columns is very simple, with no explicit StringFormat:
<
DataTemplate
x:Key
=
"Cell.Enum"
DataType
=
"telerik:GridViewCell"
>
<
TextBlock
Text
=
"{Binding Value, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:GridViewCell}}}"
/>
</
DataTemplate
>
The values for the columns actually do end up displaying correctly, with the enum values such as 'Cleared' all ok.
I suspect something is wrong with the virtualization - perhaps a column for another type is being reused for my Enum column as I scroll across, and that column's template is being applied to my enum column before all the column's settings are updated to the new column type?
Thanks in advance for your help, this is a fairly big issue for us as it's affecting scroll performance considerably.
I'm using version 2012.3.1017.40.