Hi,
I set EnterMoveNext control for a DateEdit and it does not work (the enter key shows the pop up). I have even set CloseUpKey to Empty and still the default functionality remains.
Any ideas as to why this is the case and how to change it?
We have closed this ticket because another page addresses its subject:
Problem with EnterMoveNextControl and LayoutControlEnterMoveNextControl and DateTimePropertyEditor
Answers
Hello Mark,
Thank you for your patience. I actually tested the EnableAutoTabOrder option with a non-XAF application and it worked beautifully for me.
However, after testing with an XAF application, I could reproduce your problem. After looking at the source code of the DatePropertyEditor, I found the reason for this behavior:
C#private void editor_KeyDown(object sender, KeyEventArgs e) {
if(Control.IsPopupOpen) return;
if(e.KeyCode == Keys.Enter) {
e.Handled = true;
Control.ShowPopup();
}
}
protected override object CreateControlCore() {
DateTimeEdit editor = new DateTimeEdit();
editor.KeyDown += new KeyEventHandler(editor_KeyDown);
return editor;
}
I am afraid that there is no easy way to bypass it, except for descending from the DatePropertyEditor editor and overriding its CreateControlCore method.
Thanks,
Dennis
Hello Mark,
Thank you for your message.
This behavior is specific to the XtraLayout control and its focus functionality (EnableAutoTabOrder).
Please refer to the Problem with EnterMoveNextControl and LayoutControl issue for more details.
Thanks,
Dennis
Hi Dennis,
I added this:
LayoutControl layout = View.Control as LayoutControl;
if (layout != null)
layout.OptionsFocus.EnableAutoTabOrder = false;
No change in behaviour. What am I doing wrong?