Skip to content

Instantly share code, notes, and snippets.

@derjabkin
Created September 3, 2013 10:08
Show Gist options
  • Save derjabkin/6422015 to your computer and use it in GitHub Desktop.
Save derjabkin/6422015 to your computer and use it in GitHub Desktop.
XAF: Enabling Mask on DateEdits in ASP.NET
public class DateTimeMaskController : ViewController<DetailView>
{
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
foreach (var viewItem in View.Items)
{
ASPxDateTimePropertyEditor editor = viewItem as ASPxDateTimePropertyEditor;
if (editor != null)
editor.ControlCreated += (s, e) =>
{
ASPxDateTimePropertyEditor dateTimePropertyEditor = (ASPxDateTimePropertyEditor) s;
dateTimePropertyEditor.Editor.UseMaskBehavior = true;
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment