Hello,
on version 15.1.7 the entermovenextcontrol on datetimepropertyeditor works fine, when i upgrade to version 15.1.8 stop working.
EnterMoveNextControl and DateTimePropertyEditor do not work
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
With this fix, we have introduced a new DateTimeEdit.CanShowPopupOnEnter property to control the showing popup window behavior.
When this property is set to true, the popup window will be shown on the Enter key press in edit mode. The default value of this property is true.
To resolve the problem, add the following code to your ViewItem.ControlCreated event handler:
C#void propertyEditor_ControlCreated(object sender, EventArgs e)
{
...
DXPropertyEditor propertyEditor = (DXPropertyEditor)sender;
DateTimeEdit dateTimeEdit = propertyEditor.Control as DateTimeEdit;
if (dateTimeEdit != null)
{
dateTimeEdit.CanShowPopupOnEnter = false;
}
}
- v15.2.4Download Official Update
- v15.1.9Download Official Update
- v14.2.11Download Official Update
Hello Tzanis.
It is not available yet. You will be automatically notified when a hot fix fro this issue will be ready.
Hello Tzanis.
Would you please clarify what scenario worked correctly in version 15.1.7 and is broken in 15.1.8. The EnterMoveNextControl option is not supported by DatePropertyEditor, because it is hardcoded that the Enter key opens the popup window (see ticket Q292291). I have tested it in both 15.1.7 and 15.1.8 versions, and the behavior seems to be the same.
Hello,
i implement the below controller, than set entermovenextcontrol = true for all dxpropertyeditors on detailview. This code works fine on version v15.1.7
public partial class AddEnterController : ViewController<DetailView>
{
public AddEnterController()
{
InitializeComponent();
RegisterActions(components);
// Target required Views (via the TargetXXX properties) and create their Actions.
}
protected override void OnActivated()
{
base.OnActivated();
foreach (DXPropertyEditor propertyEditor in View.GetItems<DXPropertyEditor>())
{
propertyEditor.ControlCreated += new EventHandler<EventArgs>(propertyEditor_ControlCreated);
}
// Perform various tasks depending on the target View.
}
void propertyEditor_ControlCreated(object sender, EventArgs e)
{
((DXPropertyEditor)sender).Control.EnterMoveNextControl = true;
}
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
// Access and customize the target View control.
}
protected override void OnDeactivated()
{
// Unsubscribe from previously subscribed events and release other references and resources.
foreach (DXPropertyEditor propertyEditor in View.GetItems<DXPropertyEditor>())
{
propertyEditor.ControlCreated -= new EventHandler<EventArgs>(propertyEditor_ControlCreated);
}
base.OnDeactivated();
}
}
Thanks for your reply. I have already tested a similar controller and found that it doesn't affect the built-in DatePropertyEditor because of its implementation (Q292291). I see that you mentioned DateTimePropertyEditor, which is not a part of XAF. Is it your custom property editor? If so, please provide us with its source code.
Here the code for Editor
[PropertyEditorAttribute(typeof(DateTime), "DateEditor", false)]
public class DatePropertyEditor : DXPropertyEditor
{
protected override object CreateControlCore()
{
DateTimeEdit editor = new DateTimeEdit();
return editor;
}
protected override void SetupRepositoryItem(RepositoryItem item)
{
base.SetupRepositoryItem(item);
RepositoryItemDateTimeEdit dateTimeEdit = (RepositoryItemDateTimeEdit)item;
dateTimeEdit.Init(EditMask, DisplayFormat);
dateTimeEdit.NullDate = AllowNull ? null : (object)DateTime.MinValue;
dateTimeEdit.AllowNullInput = AllowNull ? DefaultBoolean.True : DefaultBoolean.Default;
dateTimeEdit.ShowToday = true;
dateTimeEdit.ShowClear = true;
dateTimeEdit.CalendarView = CalendarView.Vista;
dateTimeEdit.VistaCalendarViewStyle = VistaCalendarViewStyle.All;
}
public override bool CanFormatPropertyValue
{
get { return true; }
}
protected override RepositoryItem CreateRepositoryItem()
{
return new RepositoryItemDateTimeEdit();
}
public DatePropertyEditor(Type objectType, IModelMemberViewItem model) : base(objectType, model) { }
public new DateEdit Control
{
get { return (DateEdit)base.Control; }
}
}
Thanks for your update, Tzanis. We will try to replicate this behavior with your custom editor and get back to you.
Hello Tzanis,
Thank you for the sample code. I have reproduced this issue and forwarded your ticket to our R&D team. We will notify you of our results shortly.