Class GridDateTimeColumn
Represents a column that displays the date time values in its cell content.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.Grid
Assembly: Syncfusion.SfGrid.WPF.dll
Syntax
public class GridDateTimeColumn : GridTextColumnBase, IDisposable, INotifyDependencyPropertyChanged, IFilterDefinition
Examples
<syncfusion:SfDataGrid x:Name="dataGrid" AutoGenerateColumns="False" ItemsSource="{Binding Orders}" >
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridDateTimeColumn CustomPattern = "dd-m-yyyy hh:mm:ss"
HeaderText="Order Date"
MappingName="OrderDate"
Pattern="CustomPattern"
AllowNullValue="True"
CanEdit = "True"
ShowRepeatButton = "False"/>
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>
Constructors
GridDateTimeColumn()
Initializes a new instance of GridDateTimeColumn class.
Declaration
public GridDateTimeColumn()
Fields
AllowNullValueProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.AllowNullValue dependency property.
Declaration
public static readonly DependencyProperty AllowNullValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.AllowNullValue dependency property.
AllowScrollingOnCircleProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.AllowScrollingOnCircle dependency property.
Declaration
public static readonly DependencyProperty AllowScrollingOnCircleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.AllowScrollingOnCircle dependency property.
CanEditProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.CanEdit dependency property.
Declaration
public static readonly DependencyProperty CanEditProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.CanEdit dependency property.
CustomPatternProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.CustomPattern dependency property.
Declaration
public static readonly DependencyProperty CustomPatternProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.CustomPattern dependency property.
DateTimeFormatProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.DateTimeFormat dependency property.
Declaration
public static readonly DependencyProperty DateTimeFormatProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.DateTimeFormat dependency property.
DisableDateSelectionProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.DisableDateSelection dependency property.
Declaration
public static readonly DependencyProperty DisableDateSelectionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.DisableDateSelection dependency property.
EnableBackspaceKeyProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableBackspaceKey dependency property.
Declaration
public static readonly DependencyProperty EnableBackspaceKeyProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableBackspaceKey dependency property.
EnableClassicStyleProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableClassicStyle dependency property.
Declaration
public static readonly DependencyProperty EnableClassicStyleProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableClassicStyle dependency property.
EnableDeleteKeyProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableDeleteKey dependency property.
Declaration
public static readonly DependencyProperty EnableDeleteKeyProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.EnableDeleteKey dependency property.
MaxDateTimeProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.MaxDateTime dependency property.
Declaration
public static readonly DependencyProperty MaxDateTimeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.MaxDateTime dependency property.
MinDateTimeProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.MinDateTime dependency property.
Declaration
public static readonly DependencyProperty MinDateTimeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.MinDateTime dependency property.
NullTextProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.NullText dependency property.
Declaration
public static DependencyProperty NullTextProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.NullText dependency property.
NullValueProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.NullValue dependency property.
Declaration
public static readonly DependencyProperty NullValueProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.NullValue dependency property.
PatternProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.Pattern dependency property.
Declaration
public static readonly DependencyProperty PatternProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.Pattern dependency property.
ShowRepeatButtonProperty
Identifies the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.ShowRepeatButton dependency property.
Declaration
public static readonly DependencyProperty ShowRepeatButtonProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
Remarks
The identifier for the Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.ShowRepeatButton dependency property.
Properties
AllowNullValue
Gets or sets a value that indicates whether the null values are allowed in GridDateTimeColumn.
Declaration
public bool AllowNullValue { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the null values are allowed in GridDateTimeColumn; otherwise , false . The default value is false. |
AllowScrollingOnCircle
Gets or sets a value that indicates whether the user can change the cell values using the mouse wheel or up and down arrow key.
Declaration
public bool AllowScrollingOnCircle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the cell value is changed using the mouse wheel or up and down arrow key; otherwise , false. The default value is true. |
CanEdit
Gets or sets a value that decides whether the date and time value can be edited.
Declaration
public bool CanEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the date and time value can be edited ; otherwise , false. The default value is false. |
CustomPattern
Gets or sets the custom pattern for date and time value.
Declaration
public string CustomPattern { get; set; }
Property Value
Type | Description |
---|---|
System.String | The custom pattern for date and time value. The default value is string.Empty. |
Remarks
To apply a CustomPattern, specify the Pattern as CustomPattern.
DateTimeFormat
Gets or sets a System.Globalization.DateTimeFormatInfo that defines the format of date and time values.
Declaration
public DateTimeFormatInfo DateTimeFormat { get; set; }
Property Value
Type | Description |
---|---|
System.Globalization.DateTimeFormatInfo | A System.Globalization.DateTimeFormatInfo that defines the format of date and time values. |
Examples
<syncfusion:GridDateTimeColumn MappingName="DateofBirth" Pattern="LongDate">
<syncfusion:GridDateTimeColumn.DateTimeFormat>
<global:DateTimeFormatInfo LongDatePattern="dd-MM-yyyy hh:mm:ss"/>
</syncfusion:GridDateTimeColumn.DateTimeFormat>
</syncfusion:GridDateTimeColumn>
DisableDateSelection
Gets or sets a value that indicates whether the date selection is disabled on the calendar pop-up of GridDateTimeColumn.
Declaration
public bool DisableDateSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the date selection is disabled on the calendar pop-up; otherwise, false. The default value is false. |
EnableBackspaceKey
Gets or sets a value that indicates whether a user can delete the date and time value by using Delete key.
Declaration
public bool EnableBackspaceKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the Delete key is enabled; otherwise , false. The default value is false. |
Remarks
The EnableDeleteKey worked based on CanEdit property.
EnableClassicStyle
Gets or sets a value that indicates whether the classic style is enabled on the drop-down of GridDateTimeColumn.
Declaration
public bool EnableClassicStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the classic style is enabled; otherwise ,false. The default value is false. |
EnableDeleteKey
Gets or sets a value that indicates whether a user can delete the date and time value by using Delete key.
Declaration
public bool EnableDeleteKey { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the Delete key is enabled; otherwise , false. The default value is false. |
Remarks
The EnableDeleteKey worked based on CanEdit property.
MaxDateTime
Gets or sets the maximum date value allowed in GridDateTimeColumn.
Declaration
public DateTime MaxDateTime { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | A System.DateTime representing the maximum date value in GridDateTimeColumn. |
MinDateTime
Gets or sets the minimum date value allowed in GridDateTimeColumn.
Declaration
public DateTime MinDateTime { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | A System.DateTime representing the minimum date value in GridDateTimeColumn. |
NullText
Gets or sets a string that is displayed instead of null value if the cell value is null.
Declaration
public string NullText { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string that is displayed instead of null value in the cell of GridDateTimeColumn. |
Remarks
The NullText is applied ,when the AllowNullValue property is enabled.
NullValue
Gets or sets a value that is displayed instead of null value if the cell value is null.
Declaration
public Nullable<DateTime> NullValue { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | A System.DateTime that is displayed instead of null value in the cells of GridDateTimeColumn. |
Remarks
The NullValue is applied ,when the AllowNullValue property is enabled.
Pattern
Gets or sets the format string for a date and time value.
Declaration
public DateTimePattern Pattern { get; set; }
Property Value
Type | Description |
---|---|
DateTimePattern | The format string for a date and time value in GridDateTimeColumn.The default value is ShortDate. |
ShowRepeatButton
Gets or sets a value that indicates whether a repeat button control is used to adjust the date and time value in GridDateTimeColumn.
Declaration
public bool ShowRepeatButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the repeat button control is used to adjust the date and time value; otherwise , false. The default value is true. |
Methods
SetDisplayBindingConverter()
Sets the converter for the
Declaration
protected override void SetDisplayBindingConverter()
Overrides
Remarks
You can override this method to specify the converter for
UpdateBindingBasedOnAllowEditing()
Updates the binding for the AllowEdit property changes in GridDateTimeColumn.
Declaration
protected override void UpdateBindingBasedOnAllowEditing()