property Grid.HasButtons as ExpandButtonEnum
Adds a button to the left side of each parent item. The user can click the button to expand or collapse the child items as an alternative to double-clicking the parent item.

 TypeDescription 
   ExpandButtonEnum An ExpandButtonEnum expression that indicates whether the control displays a + button to the left of each parent item.  

The HasButtons property has effect only if the data is displayed as a grid. Use the InsertItem property to let the control displays your data as a grid. Use the TreeColumnIndex property to select the column where the hierarchy is displayed.  Use the LinesAtRoot property to let the control displays a line that links the root items of the control. Use the CellVAlignment property to specify where the +/- AND the cell's caption is displayed in the item's client area. For instance, you can't have the +/- sign aligned to the top of the cell, and its caption aligned to the bottom. The +/- signs are always centered to the cell's caption, only the cell's caption can be aligned to the top or to the bottom of the cell's client area. The HasButtonsCustom property specifies the index of icons being used for +/- signs on parent items, when HasButtons property is exCustom. In CardView mode, the HasButtons property specifies whether the control displays an expand/collapse button in the title of the card.

The following VB sample changes the +/- button appearance:

With Grid1
    .HasButtons = ExpandButtonEnum.exWPlus
End With

The following C++ sample changes the +/- button appearance:

m_grid.SetHasButtons( 3 /*exWPlus*/ );

The following VB.NET sample changes the +/- button appearance:

With AxGrid1
    .HasButtons = EXGRIDLib.ExpandButtonEnum.exWPlus
End With

The following C# sample changes the +/- button appearance:

axGrid1.HasButtons = EXGRIDLib.ExpandButtonEnum.exWPlus;

The following VFP sample changes the +/- button appearance:

with thisform.Grid1
	.HasButtons = 3 && exWPlus
endwith

 


Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.