To reproduce:
Bind to an object with a property of type double. Start the application and edit that same column. End the editing process and you will see an exception that decimal cannot be converted to double.
Workaround:
Create the following custom editor:
public class MySpinEditor : GanttViewSpinEditor
{
public override object Value
{
get
{
object value = base.Value;
return Convert.ChangeType(value, this.ValueType);
}
set
{
base.Value = value;
}
}
}
Subscribe to the EditorInitialized and EditorRequired events and use the following event handlers:
void GanttViewElement_EditorInitialized(object sender, GanttViewItemEditorInitializedEventArgs e)
{
GanttViewSpinEditor spinEditor = e.Editor as GanttViewSpinEditor;
if (spinEditor != null)
{
spinEditor.ValueType = typeof(double);
}
}
void GanttViewElement_EditorRequired(object sender, GanttViewEditorRequiredEventArgs e)
{
if (e.EditorType == typeof(GanttViewSpinEditor))
{
e.EditorType = typeof(MySpinEditor);
}
}