I am loading an object into the PropertyGrid, and I get the below error. I use the PropertyGrid for many other types, and just one type causes this exception. Doesn't the PropertyGrid only create textboxes for types that it can handle? Is there a way to find out which property/value is causing the exception?
InnerException: System.InvalidCastException
_HResult=-2147467262
_message=Object must implement IConvertible.
HResult=-2147467262
IsTransient=false
Message=Object must implement IConvertible.
Source=mscorlib
StackTrace:
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox.ValueCoerceValueCallback(Object sender, Object value)
at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
at Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox.OnInitialized(EventArgs e)
InnerException:
Comments: ** Comment from web user: BoucherS **
InnerException: System.InvalidCastException
_HResult=-2147467262
_message=Object must implement IConvertible.
HResult=-2147467262
IsTransient=false
Message=Object must implement IConvertible.
Source=mscorlib
StackTrace:
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox.ValueCoerceValueCallback(Object sender, Object value)
at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp)
at Xceed.Wpf.Toolkit.Primitives.ValueRangeTextBox.OnInitialized(EventArgs e)
InnerException:
Comments: ** Comment from web user: BoucherS **
Hi,
Can you attach a sample showing the problem so we can reproduce to test?
Thanks.