ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1DisplayColumn.Button Property

Gets or sets a value indicating whether a drop-down button will be displayed in this column.

[Visual Basic]

Public Property Button As Boolean

[C#]

public bool Button {get;set;}

[Delphi]

public property Button: Boolean read get_Button write set_Button;

Remarks

If True, a button will be displayed in the upper right corner of the current cell at run time.

If False (the default), no button will be displayed.

Typically, the column button is enabled when wanting to drop-down a control (such as the built-in combo box, a bound list box, or even another C1TrueDBGrid control) for editing or data entry. When the button in the current cell is clicked, the C1TrueDBGrid.ButtonClick event will be raised. Then code can be written to drop-down the desired control from the cell.

Note: If both the Button and ButtonAlways properties are True, then all cells within the column are displayed with in-cell buttons, not just the current cell.

Example

The following code uses the Button property to turn off the drop-down button for regular cells in the grid:

·      Visual Basic

       ' The drop-down control is bound to the Customers table.

       Me.C1TrueDBGrid1.Columns("CustomerID").DropDown = Me.C1TrueDBDropdown1

       ' Turn on the drop-down button in the Filter Bar.

       Me.C1TrueDBGrid1.Splits(0).DisplayColumns("CustomerID").FilterButton = True

       ' Turn it off for regular cells in the grid.

       Me.C1TrueDBGrid1.Splits(0).DisplayColumns("CustomerID").Button = False

·      C#

       // The drop-down control is bound to the Customers table.

       this.c1TrueDBGrid1.Columns["CustomerID"].DropDown = this.c1TrueDBDropdown1;

       // Turn on the drop-down button in the Filter Bar.

       this.c1TrueDBGrid1.Splits[0].DisplayColumns["CustomerID"].FilterButton = true;

       // Turn it off for regular cells in the grid.

       this.c1TrueDBGrid1.Splits[0].DisplayColumns["CustomerID"].Button = false;

·      Delphi

       // The drop-down control is bound to the Customers table.

       Self.C1TrueDBGrid1.Columns['CustomerID'].DropDown := Self.C1TrueDBDropdown1;

       // Turn on the drop-down button in the Filter Bar.

       Self.C1TrueDBGrid1.Splits[0].DisplayColumns['CustomerID'].FilterButton := True;

       // Turn it off for regular cells in the grid.

       Self.C1TrueDBGrid1.Splits[0].DisplayColumns['CustomerID'].Button := False;

 

See Also

C1DisplayColumn Class | C1DisplayColumn Members | C1.Win.C1TrueDBGrid Namespace


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