DataGrid REALbasic Plugin

DataGridColumn.DefaultCell Property

Gets the DefaultCell from the Column.

DefaultCell as DataGridCell {Read}


By default the DefaultCell of the Column points to the DefaultCell of the Grid. This can be overwritten by calling CopyDefaultCell on the column which makes the column have a physical copy of the style instead of a reference.

The example bellow makes a copy of the default style to disconnect the column default style from the Grid default style, and then makes the BackColor of cells to be born in Column number one yellow. Then the code sets the factory to small checkbox.

Sub ControlCreated()
    me.Column(1).DefaultCell.BackColor = &cf0f050
    me.Column(1).CellFactoryID = CellFactoryType.SmallCheckBox
    me.Rows = 100
End Sub

The result of this example:

See Also

DataGridColumn Class