Table of Contents

Class DataGridColumnBase

Namespace
Myra.Graphics2D.UI.Data
Assembly
Myra.dll

Defines the base configuration for a DataGrid column, including its header text, bound property name, and width.

public abstract class DataGridColumnBase
Inheritance
DataGridColumnBase
Derived
Inherited Members

Constructors

DataGridColumnBase()

Initializes a new instance of the DataGridColumnBase class with default values.

public DataGridColumnBase()

DataGridColumnBase(string, int)

Initializes a new instance of the DataGridColumnBase class with the specified property and width, using the property name as the header text.

public DataGridColumnBase(string property, int width = 100)

Parameters

property string

The name of the property on the data object to bind to.

width int

The width of the column in pixels.

DataGridColumnBase(string, string, int)

Initializes a new instance of the DataGridColumnBase class with the specified property, header, and width.

public DataGridColumnBase(string property, string header, int width = 100)

Parameters

property string

The name of the property on the data object to bind to.

header string

The text displayed in the column header.

width int

The width of the column in pixels.

Properties

CellHorizontalAlignment

Gets or sets the horizontal alignment of this column's cell content. When null, the DataGrid's CellHorizontalAlignment is used instead.

public HorizontalAlignment? CellHorizontalAlignment { get; set; }

Property Value

HorizontalAlignment?

Filter

Gets or sets the filter text applied to this column. Rows whose cell value does not contain this text are hidden. Setting this property on a column that does not support filtering throws an exception.

public string Filter { get; set; }

Property Value

string

FilterStringComparison

Gets or sets the string comparison used when matching filter text against cell values for this column. When null, the DataGrid's FilterStringComparison is used instead.

public StringComparison? FilterStringComparison { get; set; }

Property Value

StringComparison?

Flags

Gets the DataGridColumnFlags describing which capabilities this column type supports.

public abstract DataGridColumnFlags Flags { get; }

Property Value

DataGridColumnFlags

HasFilter

Gets or sets whether this column shows a filter input in the filter row. Defaults to true. Ignored when the column does not have the CanFilter flag.

public bool HasFilter { get; set; }

Property Value

bool

HasSorting

Gets or sets whether this column participates in sorting. Defaults to true. Ignored when the column does not have the CanSort flag.

public bool HasSorting { get; set; }

Property Value

bool

Header

Gets or sets the display text shown in the column header.

public string Header { get; set; }

Property Value

string

HeaderHorizontalAlignment

Gets or sets the horizontal alignment of this column's header text. When null, the DataGrid's HeaderHorizontalAlignment is used instead.

public HorizontalAlignment? HeaderHorizontalAlignment { get; set; }

Property Value

HorizontalAlignment?

Property

Gets or sets the name of the property on the data item to bind this column to.

public string Property { get; set; }

Property Value

string

Width

Gets or sets the width of the column in pixels.

public int Width { get; set; }

Property Value

int

Methods

CreateWidget(object, DataGridStyle)

Creates the widget used to display the cell value. The DataGridStyle is provided so the column can apply the appropriate cell style.

public abstract Widget CreateWidget(object value, DataGridStyle style)

Parameters

value object

The bound property value of the cell.

style DataGridStyle

The active DataGrid style.

Returns

Widget

The widget to display, or null for an empty cell.