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
435
Multiple issue with XamDateTimeEditor
posted

We have two date controls as From and To and have validation of each date, if validation fails user should stay on the same field. Also we want date control to appear with date mask (  /  /    ) and dropdown icon.

I was able to do this with following settings and validation code with setting focus (not given here)

 <igEditors:XamDateTimeEditor DropDownButtonDisplayMode="Always"

 

 

DisplayMode="IncludeBoth" IsAlwaysInEditMode="True"/>

Issues that we are having now as below,

 

1. We used IsAlwaysInEditMode="True" to make the mask appear to the user without actually start entering the date. But this is causing date value not being notified to view model. This may be because IsAlwaysInEditMode="True" means EditModeStarted and EditModeEnded will be ignored with this setting.

2.  We used DropDownButtonDisplayMode="Always" to show the dropdown to the user without actually mouse over on the date control. This is causing user to leave the one date control with the business errored date to the other when user click the dropdown icon of the other date control.

Please guide us in the right direction, Thanks

Parents
No Data
Reply
  • 54937
    Offline posted

    Tusky said:

    1. We used IsAlwaysInEditMode="True" to make the mask appear to the user without actually start entering the date. But this is causing date value not being notified to view model. This may be because IsAlwaysInEditMode="True" means EditModeStarted and EditModeEnded will be ignored with this setting.

    It is true that when IsAlwaysInEditMode that the EditModeEnded won't be raised but that's because you're telling the control to always be in edit mode but I'm not sure what you mean by not notifying the view model. Assuming that you are binding the Value property of the xamDateTimeEditor to a property on your datacontext, etc. then I'm not sure I understand what that has to do with EditModeStarted/Ended? 

    Tusky said:

    2.  We used DropDownButtonDisplayMode="Always" to show the dropdown to the user without actually mouse over on the date control. This is causing user to leave the one date control with the business errored date to the other when user click the dropdown icon of the other date control.

    When I type something in that doesn't validate and try to click on the dropdown button of a different xamDateTimeEditor, the validation error messagebox is shown and the other control doesn't receive focus and doesn't show its dropdown. I'm guessing that the custom validation logic that you mentioned is happening after the control has already lost focus and the the xamDateTimeEditor is receiving focus so it should drop down. If you have custom validation logic then perhaps the best thing to do is to set the ValueConstraint and put your validation logic there. If the validation logic doesn't fall into one of the constraints it exposes (e.g. MinInclusive, MinExclusive, etc.) then you can create your own ValidationRule and add it to the ValidationRules of the ValueConstraint.

Children