I try to use the EditorProviders width the WebDateChooserProvider for date fields this works fine. But when I use the WebDateChooserProvider for a nullable column then I get the error below.
Editor with ID: NullableDateColumn cannot edit column with Key: NullableDateColumn. The editor does not support the column type.
Is it a known issue that WebDateChooserProvider not support nullable datetime fields. Is there a solution to use the EditorProvider for nullable datetime?
My dirty solution for so far.
I extend the WebDateChooserProvider class and override the method bool CanEditType(Type t).
This method return now true if it's a datetime field, nullable datetime field or a string. Why the string is necessary? I don't know but it works. When by a string type return false the grid will be display an error if I bind an empty list. I use linq for my database connection and I cast the result recordset to a List<Data model object>.
public class NullableDateTimeEditorProvider : Infragistics.Web.UI.GridControls.WebDateChooserProvider { protected override bool CanEditType(Type t) { if (t.Name.Contains("Nullable")) { return t.FullName.Contains("System.DateTime"); // Nullable datetime support! } else if (t.Name.Contains("String")) { return true; // Strings also true. Why? Read the description } else { return base.CanEditType(t); // Otherwise check the base method } } }
Hello,
The problem was not reported to us yet. I have created a bug report for it. Please contact the developer support to be added to the notification list. As soon as the problem is resolved you will be notified. The work item to mention is: 18040.
Thank you.