Posted 1 March 2023, 8:36 pm EST
Hi C1,
attached solution contains two samples for .NET6 and .NET48: a C1.Win.Calendar.C1DateEdit is placed on a UserControl, which is used as C1FlexGrid column editor by implementing “IEmbeddedEditor” (.NET6) or “IC1EmbeddedEditor” (.NET 4.8).
FlexValidate.zip
In the .NET6 version, the control value is not applied to the grid cell: click in the cell, change the value by typing a new date, then click outside of the editor.
In .NET 4.8, it works fine.
It seems to be a problem of my code in “GetValue”: here I return “C1DateEdit.Value”, which does not contain the new value.
I could workaround this problem by triggering validation in “IEmbeddedEditor.IsValueValid”:
public bool IsValueValid()
{
//Force validation of the C1DateEdit:
return this.Validate();
}
By the way: I also added PostValidation code to cancel on invalid values, and this is triggered even without my workaround. So the problem is only that the value is not applied to the “Value” picker.
What do you think? Is this a bug in the control? Or is my workaround necessary in the .NET6 version? Is there even a better workaround?
Best regards
Wolfgang