In XamDateTimeInput, I am having the following validation,
<ig:XamDateTimeInput.ValueConstraint> <ig:ValueConstraint MaxInclusive="{Binding Source={x:Static System:DateTime.Now}}" Nullable="False" /> </ig:XamDateTimeInput.ValueConstraint>
On Clearing the value in the control - making date as null and tabing out. A validation message box is displayed - "Value cannot be null" . But the focus is going to the next control.
If the value in the DateTimeINput control is invalid, Can't we make the focus not to move out of the control, until the user enters a valid value?
Hello ,
Thank you for your post.
I have been looking into it and what I can suggest is to take a look at the following forum thread where you can see how to set focus to control:
http://es.infragistics.com/community/forums/t/90213.aspx
Basically you can handle ValidationError event of XamDateTimeInput and in the event handler you can use Focus method of Keyboard. The following code snipped illustrate this:
private void input_ValidationError(object sender, EditModeValidationErrorEventArgs e)
{
if ((sender as XamDateTimeInput).Value == null)
Keyboard.Focus(XamDateTimeInputName);
}
Please let me know if you need any further assistance on the matter.
Hello,
I am just checking if my last reply was helpful for you.
If you require any further assistance please do not hesitate to ask.