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
propertystringThe name of the property on the data object to bind to.
widthintThe 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
propertystringThe name of the property on the data object to bind to.
headerstringThe text displayed in the column header.
widthintThe 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
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
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
Flags
Gets the DataGridColumnFlags describing which capabilities this column type supports.
public abstract DataGridColumnFlags Flags { get; }
Property Value
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
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
Header
Gets or sets the display text shown in the column header.
public string Header { get; set; }
Property Value
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
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
Width
Gets or sets the width of the column in pixels.
public int Width { get; set; }
Property Value
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
valueobjectThe bound property value of the cell.
styleDataGridStyleThe active DataGrid style.
Returns
- Widget
The widget to display, or
nullfor an empty cell.