Completed
Last Updated: 08 Oct 2019 16:27 by ADMIN
Release R3 2019 SP1
Dimitar
Created on: 01 Oct 2019 06:44
Category: GridView
Type: Bug Report
0
RadGridView: The FreeFormDateTimeProvider is not validated correctly

When pressing Enter or Tab in the new row the ParsingDateTime event is fired after the editor is validated. Use attached to reproduce.

 

private void GridView_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    var editor = gridView.ActiveEditor as RadDateTimeEditor;
    var editorElement = editor.EditorElement as RadDateTimeEditorElement;
    editorElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime;
    var provider = ((FreeFormDateTimeProvider)editorElement.TextBoxElement.Provider);
    editorElement.TextBoxElement.Provider = new MyFreeFormDateTimeProvider(provider.Mask, provider.Culture, provider.Owner);
}

class MyFreeFormDateTimeProvider : FreeFormDateTimeProvider
{
    public MyFreeFormDateTimeProvider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner) : base(mask, culture, owner)
    {
    }
    public override bool Validate(string stringValue)
    {
        //do your code here
        return base.Validate(stringValue);
    }
}
Attached Files:
0 comments