ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Rendering Cells as Command Buttons

To render the current cell as a non-editable command button within a C1DisplayColumn object, set its ButtonText property to True in code:

·      Visual Basic

Me.C1TrueDBGrid1.Splits(0).DisplayColumns(0).ButtonText = True

·      C#

this.C1TrueDBGrid1.Splits(0).DisplayColumns(0).ButtonText = true;

·      Delphi

Self.C1TrueDBGrid1.Splits[0].DisplayColumns[0].ButtonText := True;

When a cell within the column receives focus, it is rendered as a standard Windows command button using the cell text as the caption. The cell text is not centered automatically, but respects the column's horizontal and vertical alignment settings.

If both the Button and ButtonText properties are True, the ButtonText property takes precedence.

As with the default in-cell button, set the column's ButtonAlways property to True to force all of its cells to be displayed as command buttons. Only the current cell is drawn with a focus rectangle, however.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.