All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
1.1
The page you are viewing does not exist in version 1.1. This link will take you to the root page.

TimeColumn Class

A grid column used to display and edit the time.

Namespace: DevExpress.XamarinForms.DataGrid

Assembly: DevExpress.XamarinForms.Grid.dll

Declaration

public class TimeColumn :
    TextColumnBase

Remarks

The TimeColumn is a column in the DataGridView that displays DateTime or TimeSpan values.

When a user taps a cell, the standard iOS or Android time picker appears that allows the user to select the time.

Options

Use the following properties to adjust column settings:

  • TimeFormatMode — specifies whether values in cells are displayed in 12- or 24-hour format.
  • IsTimeIconVisible — specifies whether the time icon is displayed in the focused cell.

You can configure the following options related to all types of grid columns:

  • FieldName — specifies the name of the data source's field associated with the grid column, or serves as an identifier for an unbound column.
  • Caption — specifies the caption displayed in the column header.
  • DisplayFormat — specifies the pattern used to format values in the column's cells.
  • HorizontalContentAlignment, VerticalContentAlignment — specify the horizontal and vertical alignment of the column's content.
  • MinWidth, MaxWidth, Width — specify the column's minimum, maximum, and actual widths.
  • IsVisible — specifies whether the column is visible in the grid.

Use the following properties to sort and group data in the grid, and calculate cell values based on expressions:

The grid stores columns in the DataGridView.Columns collection. Depending on the AutoGenerateColumnsMode option, the grid automatically generates columns based on the bound data source, or you can add columns to the grid and associate them with data fields manually. See the following help topic for an example: Create Columns for Different Data Types.

Examples

The example below binds a TimeColumn to a TimeSpan data field.

<dxg:DataGridView ItemsSource="{Binding Path=OutlookData}">
    <dxg:DataGridView.Columns>
        <dxg:TimeColumn FieldName="Time"
                        IsTimeIconVisible="True"
                        TimeFormatMode="HourFormat12"/>
    </dxg:DataGridView.Columns>
</dxg:DataGridView>

Inheritance

Object
Xamarin.Forms.BindableObject
See Also