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
330
XamDateTimeEditor without the DateTime
posted

Hello,

We currently utilize the XamDateTimeEditor and it works great so far, except we have a rather odd requirement. The requirement is that when the screen is in what we call search mode, then the user can enter in whatever they want into our controls. For example, the user could enter in ">02/01/2009" into the date field to search for records that have a date greater than 02/01/2009.  I had hoped that I could simply change the ValueType at runtime via a converter from DateTime to string (depending on screen mode), but this does not resolve the issue because the control will still try to internally set the DateValue to a DateTime via the SyncValuePropertiesOverride method. 

Does anyone have any suggestions or workarounds to get this control to behave how we would like it? So far, it looks like my only option is to write our own control.

Thanks in advanced,

-Mike

Parents
  • 69686
    posted

    Hello Mike,

     

    I believe you can change change the Mask property of the XamDateTimerEditor and it will no longer require a DateTime formatting. For example, you can set it to numeric or alphanumeric mask for input, something like this:

     

    private void searchMode_Click(object sender, RoutedEventArgs e)

            {

                if (searchMode.IsChecked.Value)

                {

                    xamDateTimeEditor1.Mask = "########";

                }

                else

                {

                    xamDateTimeEditor1.ClearValue(XamDateTimeEditor.MaskProperty);

                }

            }

    Note that # is a digit placeholder and & is a char placeholder. Moreover, you can see all of the supported masks here : http://help.infragistics.com/Help/NetAdvantage/WPF/2009.2/CLR3.5/html/xamEditors_Masks.html

     

Reply Children