DataGrid REALbasic Plugin

DataGridColumn.CopyDefaultCell Method

Makes the Column have a physical copy of the Grid's Default style instead of just having a reference to it. This is needed when a column is to have a different set of default cells than the rest of the Grid.

CopyDefaultCell()

Parameters

Remarks

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).CopyDefaultCell()
    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