GridDateTimeColumn
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:
public class GridDateTimeColumn : GridBoundColumn, IStateManager, IComparable, IGridEditableColumn, IGridDataColumn
Inheritance: objectGridColumnGridEditableColumnGridBoundColumnGridDateTimeColumn
Implements:
Inherited Members
Example:
<telerik:GridDateTimeColumn FooterText="GridDateTimeColumn footer" UniqueName="OrderDate" SortExpression="OrderDate"
HeaderText="GridDateTimeColumn" DataFormatString="{0:D}" DataField="OrderDate">
</telerik:GridBoundColumn>
Constructors
[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
public virtual string EditDataFormatString { get; set; }
Gets or sets if range filtering is enabled for the column
public virtual bool EnableRangeFiltering { get; set; }
Gets or sets if only date portion of the date is taken in effect when filtering
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
public virtual string FilterDateFormat { get; set; }
Gets or sets the MaxDate property of the RadDateInput controls.
public DateTime MaxDate { get; set; }
The MaxDate property of the RadDateInput controls.
Gets or sets the MinDate property of the RadDateInput controls.
public DateTime MinDate { get; set; }
The MinDate property of the RadDateInput controls.
Gets or sets the picker type that will be used when rendering the column.
public GridDateTimeColumnPickerType PickerType { get; set; }
Methods
Creates a copy of the current column.
public override GridColumn Clone()
Overrides:
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
protected override void CopyBaseProperties(GridColumn fromColumn)
Overrides:
protected override IGridColumnEditor CreateDefaultColumnEditor()
Overrides:
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.
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
public override string EvaluateFilterExpression(GridFilteringItem filteringItem)
Overrides:
Gets a list of filter functions based on the settings of the FilterListOptions property.
protected override ArrayList GetFilterFunctionsList(GridFilterListOptions options, ArrayList sourceList)
Overrides:
Sets the value of the property CurrentFilterValue as a text on the TextBox control found in the cell
protected override void SetCurrentFilterValueToControl(TableCell cell)
Overrides:
Instantiates the filter controls (text-box, image.) in the cell given