New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

A column type for the RadGrid control that is bound to a field in a data source which is of type DateTime. Displays RadDatePicker, RadDateTimePicker or RadDateInput for editor and filter control.

The default data binding (when AutoGenerateColumns property is set to true) generates GridDateTimeColumn type of column for source field which is of type DateTime. It displays each item from the DataSource field as text in regular mode. This column is editable (implements the IGridEditableColumn interface) and provides by default GridDateTimeColumnEditor, used for editing the date in each item.

GridDateTimeColumn has three similar and yet different properties controlling its visibility and rendering in a browser in regular and in edit mode:

  • Display - concerns only the appearance of the column in browser mode, client-side. The column will be rendered in the browser but all the cells will be styled with display: none. The column editor will be visible in edit mode.
  • Visible - will stop the column cells from rendering in browser mode. The column will be visible in edit mode.
  • ReadOnly - the column will be displayed according to the settings of previous properties in browser mode but will not appear in the edit-form.
    None of these properties can prevent you from accessing the column cells' content server-side using the UniqueName of the column.

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class GridDateTimeColumn : GridBoundColumn, IStateManager, IComparable, IGridEditableColumn, IGridDataColumn

Inheritance: objectGridColumnGridEditableColumnGridBoundColumnGridDateTimeColumn

Implements: IComparableIGridDataColumnIGridEditableColumnIStateManager

Inherited Members GridBoundColumn.formattingGridBoundColumn.thisExprGridBoundColumn.FormatDataValue(object, GridItem)GridBoundColumn.FormatDataValue(object, GridItem, bool)GridBoundColumn.Initialize()GridBoundColumn.InitializeCell(TableCell, int, GridItem)GridBoundColumn.ColumnEditorChange(IGridColumnEditor)GridBoundColumn.SupportsFiltering()GridBoundColumn.GetFilterDataField()GridBoundColumn.GetDefaultGroupByExpression()GridBoundColumn.IsBoundToFieldName(string)GridBoundColumn.GenerateUniqueName()GridBoundColumn.FillValues(IDictionary, GridEditableItem)GridBoundColumn.GetCustomPropertyDataFields(object)GridBoundColumn.DataFieldGridBoundColumn.ColumnValidationSettingsGridBoundColumn.AggregateGridBoundColumn.HtmlEncodeGridBoundColumn.EmptyDataTextGridBoundColumn.FooterAggregateFormatStringGridBoundColumn.MaxLengthGridBoundColumn.DataFormatStringGridBoundColumn.IsEditableGridEditableColumn.SetDefaultColumnEditor(IGridColumnEditor)GridEditableColumn.GetEditableColumn()GridEditableColumn.ShouldExtractValues(GridEditableItem)GridEditableColumn.ConvertValueIfEmpty(string)GridEditableColumn.GetActiveDataField()GridEditableColumn.ColumnEditorIDGridEditableColumn.MobileEditorGridEditableColumn.CurrentColumnEditorGridEditableColumn.InnerColumnEditorGridEditableColumn.ColumnEditorGridEditableColumn.ConvertEmptyStringToNullGridEditableColumn.UseNativeEditorsInMobileModeGridEditableColumn.DefaultInsertValueGridEditableColumn.ReadOnlyGridEditableColumn.InsertVisiblityModeGridEditableColumn.ForceExtractValueGridEditableColumn.AllowSortingGridEditableColumn.SortableGridEditableColumn.AllowFilteringGridColumn.ShouldSerializeFilterImageUrl()GridColumn.ShouldSerializeSortAscImageUrl()GridColumn.ShouldSerializeSortDescImageUrl()GridColumn.RefreshCurrentFilterValue(GridFilteringItem, string)GridColumn.RefreshCurrentFilterValue(GridFilteringItem)GridColumn.FunctionTakesNoArguments(GridKnownFunction)GridColumn.PrepareCell(TableCell, GridItem)GridColumn.LoadViewState(object)GridColumn.OnColumnChanged()GridColumn.SaveViewState()GridColumn.TrackViewState()GridColumn.ResetCurrentFilterValue(GridFilteringItem)GridColumn.ResetCurrentFilterValue()GridColumn.IsUniqueName(string)GridColumn.GenerateUniqueNameBase(string)GridColumn.TrySetOnClientClickScript(Control, GridItem, string, params string[])GridColumn.UpdateUniqueNameIfDefault(string)GridColumn.HeaderTooltipGridColumn.HeaderAbbrGridColumn.HeaderAxisGridColumn.SortedBackColorGridColumn.CurrentFilterValueGridColumn.AndCurrentFilterValueGridColumn.ColumnGroupNameGridColumn.SelectedGridColumn.SelectableGridColumn.CurrentFilterFunctionGridColumn.AndCurrentFilterFunctionGridColumn.FilterDelayGridColumn.ExportableGridColumn.EnableHeaderContextMenuGridColumn.ShowFilterIconGridColumn.FilterListOptionsGridColumn.AutoPostBackOnFilterGridColumn.FilterImageToolTipGridColumn.FilterControlToolTipGridColumn.EditorControlToolTipGridColumn.FilterImageUrlGridColumn.SortAscImageUrlGridColumn.SortDescImageUrlGridColumn.DataTypeNameGridColumn.ListOfFilterValuesGridColumn.FilterTemplateGridColumn.TableViewSpecificStateGridColumn.DesignModeGridColumn.FooterStyleGridColumn.FooterTextGridColumn.HeaderImageUrlGridColumn.HeaderStyleGridColumn.HeaderTextGridColumn.IsTrackingViewStateGridColumn.ItemStyleGridColumn.OwnerGridColumn.SortExpressionGridColumn.GroupByExpressionGridColumn.ViewStateGridColumn.ShowSortIconGridColumn.ShowNoSortIconGridColumn.VisibleGridColumn.DisplayGridColumn.OwnerIDGridColumn.OwnerGridIDGridColumn.ResizableGridColumn.ReorderableGridColumn.GroupableGridColumn.ColumnTypeGridColumn.HeaderButtonTypeGridColumn.OrderIndexGridColumn.IsDefaultUniqueNameGridColumn.EditFormColumnIndexGridColumn.UniqueNameGridColumn.EditFormHeaderTextFormatGridColumn.DataTypeGridColumn.FilterControlWidthGridColumn.FilterControlAltTextGridColumn.FilterCheckListWebServiceMethodGridColumn.FilterCheckListEnableLoadOnDemandobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Example:

            <telerik:GridDateTimeColumn FooterText="GridDateTimeColumn footer" UniqueName="OrderDate" SortExpression="OrderDate"
HeaderText="GridDateTimeColumn" DataFormatString="{0:D}" DataField="OrderDate">
</telerik:GridBoundColumn>

Constructors

C#
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public GridDateTimeColumn()

Properties

Gets or sets the data format that will be applied to the edit field when a GridDataItem is edited in RadGrid

C#
public virtual string EditDataFormatString { get; set; }

Gets or sets if range filtering is enabled for the column

C#
public virtual bool EnableRangeFiltering { get; set; }

Gets or sets if only date portion of the date is taken in effect when filtering

C#
public virtual bool EnableTimeIndependentFiltering { get; set; }

Gets or sets the date format that will be applied to the filter date input when filtering is enabled

C#
public virtual string FilterDateFormat { get; set; }

Gets or sets the MaxDate property of the RadDateInput controls.

C#
public DateTime MaxDate { get; set; }
Property Value:

The MaxDate property of the RadDateInput controls.

Gets or sets the MinDate property of the RadDateInput controls.

C#
public DateTime MinDate { get; set; }
Property Value:

The MinDate property of the RadDateInput controls.

Gets or sets the picker type that will be used when rendering the column. If you use DataType="TimeSpan", change the PickerType to "TimePicker" and the pickers UseTimeSpanForBinding property will be automatically set to "true".

C#
public GridDateTimeColumnPickerType PickerType { get; set; }

Methods

Creates a copy of the current column.

C#
public override GridColumn Clone()
Returns:

GridColumn

Overrides: GridBoundColumn.Clone()

Note: When implementing/overriding this method be sure to call the base member or call CopyBaseProperties to be sure that all base properties will be copied accordingly

C#
protected override void CopyBaseProperties(GridColumn fromColumn)
Parameters:fromColumnGridColumn

Overrides: GridBoundColumn.CopyBaseProperties(GridColumn)

C#
protected override IGridColumnEditor CreateDefaultColumnEditor()
Returns:

IGridColumnEditor

Overrides: GridBoundColumn.CreateDefaultColumnEditor()

Evaluates the column filter expression based on the CurrentFilterFunction, CurrentFilterValue, AndCurrentFilterFunction, AndCurrentFilterValue propeties. It could be used to handle custom filtering and is internally used for determining GridTableView FilterExpression value.

C#
public override string EvaluateFilterExpression()
Returns:

string

Overrides: GridColumn.EvaluateFilterExpression()

Gets a string representing a filter expression, based on the settings of all columns that support filtering, with a syntax ready to be used by a DataView object

C#
public override string EvaluateFilterExpression(GridFilteringItem filteringItem)
Parameters:filteringItemGridFilteringItemReturns:

string

Overrides: GridColumn.EvaluateFilterExpression(GridFilteringItem)

Gets the value of the Text property of a textbox control found in the cell, used to set the value of the CurrentFilterValue property.

C#
protected override string GetCurrentFilterValueFromControl(TableCell cell)
Parameters:cellTableCellReturns:

string

Overrides: GridColumn.GetCurrentFilterValueFromControl(TableCell)

C#
protected Control GetFilterControlFromCell(TableCell cell, string radDatePickerId, string radDateInputId)
Parameters:cellTableCellradDatePickerIdstringradDateInputIdstringReturns:

Control

C#
protected List<Control> GetFilterControls(TableCell cell)
Parameters:cellTableCellReturns:

List<Control>

Gets a list of filter functions based on the settings of the FilterListOptions property.

C#
protected override ArrayList GetFilterFunctionsList(GridFilterListOptions options, ArrayList sourceList)
Parameters:optionsGridFilterListOptionssourceListArrayListReturns:

ArrayList

Overrides: GridColumn.GetFilterFunctionsList(GridFilterListOptions, ArrayList)

Sets the value of the property CurrentFilterValue as a text on the TextBox control found in the cell

C#
protected override void SetCurrentFilterValueToControl(TableCell cell)
Parameters:cellTableCell

Overrides: GridColumn.SetCurrentFilterValueToControl(TableCell)

Instantiates the filter controls (text-box, image.) in the cell given

C#
protected override void SetupFilterControls(TableCell cell)
Parameters:cellTableCell

Overrides: GridColumn.SetupFilterControls(TableCell)