Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
Min & Max Value for XamDateTimeEditor
posted

Hi,

I have a Datagrid with a DateTime field in it. By Default I get the XamDateTimeEditor to edit the Value of the Field.

Is it possible to set a minimun and maximum Date like in the XamMonthCalendar. (Disabled Date Ranges)

Or do you know an workarround how to limit the selection. Maybe something like using the MonthCalendar and styling it like the DateTimeEditor...

Yours sincrealy

Thomas

Parents
No Data
Reply
  • 69686
    posted

    Hello Thomas,

    The XamDateTimeEditor uses internally the month calendar when it is in edit mode. The ValueEditors have ValueConstraints which you can use to sex min - max range of the dates. Here is some sample code for doing so:

     Style s = new Style(typeof(XamDateTimeEditor));

                ValueConstraint constraint = new ValueConstraint();

                constraint.MaxInclusive = new DateTime(2009, 10, 15);

                constraint.MinExclusive = new DateTime(2009, 10, 1);

                Setter st = new Setter(XamDateTimeEditor.ValueConstraintProperty, constraint);

                s.Setters.Add(st);

Children