WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridDateTimeColumn

    Show / Hide Table of Contents

    Class GridDateTimeColumn

    Represents a column that displays the date time values in its cell content.

    Inheritance
    System.Object
    SfGridColumnBase<SfGridBase>
    GridColumnBase
    GridColumn
    GridTextColumnBase
    GridDateTimeColumn
    Implements
    System.IDisposable
    INotifyDependencyPropertyChanged
    IFilterDefinition
    Inherited Members
    GridTextColumnBase.TextTrimmingProperty
    GridTextColumnBase.TextWrappingProperty
    GridTextColumnBase.TextDecorationsProperty
    GridTextColumnBase.TextTrimming
    GridTextColumnBase.TextWrapping
    GridTextColumnBase.TextDecorations
    GridColumn.FilterRowCellStyleProperty
    GridColumn.UseBindingValueProperty
    GridColumn.ColumnSizerProperty
    GridColumn.AllowDraggingProperty
    GridColumn.AllowGroupingProperty
    GridColumn.AllowResizingProperty
    GridColumn.AllowFilteringProperty
    GridColumn.ImmediateUpdateColumnFilterProperty
    GridColumn.FilterRowOptionsVisibilityProperty
    GridColumn.FilterRowConditionProperty
    GridColumn.FilterPopupStyleProperty
    GridColumn.FilterPopupTemplateProperty
    GridColumn.AllowBlankFiltersProperty
    GridColumn.FilterRowTextProperty
    GridColumn.IsCaseSensitiveFilterRowProperty
    GridColumn.GroupModeProperty
    GridColumn.SortModeProperty
    GridColumn.OnCellTemplateSelectorChanged(DependencyPropertyChangedEventArgs)
    GridColumn.OnCellTemplateChanged(DependencyPropertyChangedEventArgs)
    GridColumn.CanAllowSpinOnMouseScroll()
    GridColumn.Dispose(Boolean)
    GridColumn.GetRowFilterType()
    GridColumn.GetFilterRowOptionsVisibility()
    GridColumn.SetCellType(String)
    GridColumn.CanFocus()
    GridColumn.IsHiddenColumn()
    GridColumn.CanEditCell(Int32)
    GridColumn.CreateInstanceCore()
    GridColumn.CanEndEditColumn()
    GridColumn.SetFilterRowText(String)
    GridColumn.OnDependencyPropertyChanged(String, DependencyPropertyChangedEventArgs)
    GridColumn.ColumnMemberType
    GridColumn.FilterRowCellStyle
    GridColumn.UseBindingValue
    GridColumn.ColumnSizer
    GridColumn.AllowDragging
    GridColumn.AllowGrouping
    GridColumn.AllowResizing
    GridColumn.AllowFiltering
    GridColumn.ImmediateUpdateColumnFilter
    GridColumn.FilterRowOptionsVisibility
    GridColumn.FilterRowCondition
    GridColumn.FilterPopupStyle
    GridColumn.FilterPopupTemplate
    GridColumn.AllowBlankFilters
    GridColumn.FilterRowText
    GridColumn.IsCaseSensitiveFilterRow
    GridColumn.GroupMode
    GridColumn.SortMode
    GridColumn.CellType
    GridColumn.FilteredFrom
    GridColumn.DataGrid
    GridColumn.FilterPredicates
    GridColumn.FilterBehavior
    GridColumn.ColumnFilter
    GridColumn.FilterRowEditorType
    GridColumnBase.ActualWidthProperty
    GridColumnBase.MappingNameProperty
    GridColumnBase.HeaderTextProperty
    GridColumnBase.AllowEditingProperty
    GridColumnBase.IsReadOnlyProperty
    GridColumnBase.GridValidationModeProperty
    GridColumnBase.UpdateTriggerProperty
    GridColumnBase.PaddingProperty
    GridColumnBase.AllowFocusProperty
    GridColumnBase.HeaderTemplateProperty
    GridColumnBase.CellTemplateProperty
    GridColumnBase.SetCellBoundValueProperty
    GridColumnBase.CellTemplateSelectorProperty
    GridColumnBase.CellStyleProperty
    GridColumnBase.CellStyleSelectorProperty
    GridColumnBase.HeaderStyleProperty
    GridColumnBase.AllowSortingProperty
    GridColumnBase.VerticalAlignmentProperty
    GridColumnBase.TextAlignmentProperty
    GridColumnBase.HorizontalHeaderContentAlignmentProperty
    GridColumnBase.WidthProperty
    GridColumnBase.IsHiddenProperty
    GridColumnBase.MaximumWidthProperty
    GridColumnBase.MinimumWidthProperty
    GridColumnBase.ShowHeaderToolTipProperty
    GridColumnBase.ToolTipTemplateProperty
    GridColumnBase.HeaderToolTipTemplateProperty
    GridColumnBase.ToolTipTemplateSelectorProperty
    GridColumnBase.ShowToolTipProperty
    GridColumnBase.SetCellBoundToolTipProperty
    GridColumnBase.OnUpdateBindingInfo(DependencyObject, DependencyPropertyChangedEventArgs)
    GridColumnBase.SetValueBindingConverter()
    GridColumnBase.CanEditCell()
    GridColumnBase.UpdateBindingForValidation(GridValidationMode)
    GridColumnBase.GetTypeface(GridColumnBase, GridCell)
    GridColumnBase.IsAutoGenerated
    GridColumnBase.IsTemplate
    GridColumnBase.ActualWidth
    GridColumnBase.MappingName
    GridColumnBase.HeaderText
    GridColumnBase.AllowEditing
    GridColumnBase.IsReadOnly
    GridColumnBase.GridValidationMode
    GridColumnBase.UpdateTrigger
    GridColumnBase.Padding
    GridColumnBase.AllowFocus
    GridColumnBase.HeaderTemplate
    GridColumnBase.CellTemplate
    GridColumnBase.SetCellBoundValue
    GridColumnBase.CellTemplateSelector
    GridColumnBase.CellStyle
    GridColumnBase.CellStyleSelector
    GridColumnBase.HeaderStyle
    GridColumnBase.AllowSorting
    GridColumnBase.VerticalAlignment
    GridColumnBase.TextAlignment
    GridColumnBase.HorizontalHeaderContentAlignment
    GridColumnBase.Width
    GridColumnBase.IsHidden
    GridColumnBase.MaximumWidth
    GridColumnBase.MinimumWidth
    GridColumnBase.ValueBinding
    GridColumnBase.DisplayBinding
    GridColumnBase.ShowHeaderToolTip
    GridColumnBase.ToolTipTemplate
    GridColumnBase.HeaderToolTipTemplate
    GridColumnBase.ToolTipTemplateSelector
    GridColumnBase.ShowToolTip
    GridColumnBase.SetCellBoundToolTip
    SfGridColumnBase<SfGridBase>.Dispose()
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 Description
    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 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 of column.

    Declaration
    protected override void SetDisplayBindingConverter()
    Overrides
    GridTextColumnBase.SetDisplayBindingConverter()
    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()
    Overrides
    GridColumn.UpdateBindingBasedOnAllowEditing()

    Implements

    System.IDisposable
    INotifyDependencyPropertyChanged
    IFilterDefinition
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved