DateEdit.SyncSelectionWithEditValue Property
Gets or sets whether changing the edit value in code updates the calendar selection.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v25.2.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
[DefaultValue(true)]
[DXCategory("Behavior")]
public bool SyncSelectionWithEditValue { get; set; }
Property Value
| Type | Default | Description |
|---|---|---|
| Boolean | true |
|
Remarks
When the SyncSelectionWithEditValue property is true (the default behavior), the calendar selection is automatically updated to match the date specified by the DateTime / EditValue property whenever the edit value change in code.
Set the SyncSelectionWithEditValue property to false to manage calendar selection (SelectedRanges) independently of the edit value (for example, when multiple dates or date ranges are selected).
The following code snippet disables synchronization and enables independent date range selection:
using DevExpress.XtraEditors.Repository;
dateEdit1.Properties.SelectionMode = CalendarSelectionMode.Multiple;
dateEdit1.SyncSelectionWithEditValue = false;
dateEdit1.UpdateSelectionWhenNavigating = true;
Note
The UpdateSelectionWhenNavigating property requires SyncSelectionWithEditValue to be set to false.