Hi,
We are facing an focus issue with the UltraDateTimeEditor control. UltraDateTimeEditor doesn't give up the focus once selected. I cannot tab out of the control or even clicking outside the control, it doesn't leave the focus.
We are binding UltraDateTimeEditor control with TableAdapter.
On debugging I found that:
After AfterExitEditMode event, it re-enters the editing state for some reason. Below is the sequence of the events fired.
Now the problem is that After Validating event, it re-enters the Edit Mode..
private void _deVisitStartTime_BeforeExitEditMode(object sender, Infragistics.Win.BeforeExitEditModeEventArgs e)
{
}
private void _deVisitStartTime_AfterExitEditMode(object sender, EventArgs e) { }
private void _deVisitStartTime_Validating(object sender, CancelEventArgs e) { e.Cancel = true; }
private void _deVisitStartTime_BeforeEnterEditMode(object sender, CancelEventArgs e) { e.Cancel = true; } private void _deVisitStartTime_AfterEnterEditMode(object sender, EventArgs e) { }
And it stucks within these events and so not leaving the focus out of it.
Please suggest why it is re-focusing the control, after exiting it.
How I can resolve this issue, so that it allows me to leave this control.
I have reffered to some similar problem post and tried what was suggested there, but had no luck.
http://news.infragistics.com/forums/t/63159.aspx
Thanks,
Balraj
Hi Balraj,
It's because you are cancelling the Validating event. That's what the Cancel parameter does - it prevents you from leaving the control. This is true of any control - this event is not even an event of the UltraDateTimeEditor, it's an event on Control.
Thanks for your response.
But I am facing this issue when non of these event are captured. I have captured these events just for identifing the problem.
Even I remove all these events, i.e. nothing like cancelling the Validating event, still the issue persists..
What could be the other possible reason for this behaviour. Please suggest!
Okay... I was confused, then, because you specifically posted code here that shows you are cancelling the Validating event.
If you are not handling any of these events and you still cannot leave the control then either the text within that control is not valid for the date mask, or else your DateTimeEditor is bound to a DataSource and the DataSource is rejecting the value you entered.
Are you binding the control? If so, what property are you binding and what is the data type of the field you are binding it to?