Spread Windows Forms 10.0 Product Documentation
AutoWidth Property (ComboDropDownInfo)
Example 


Gets or sets whether to calculate the width for the drop-down window when opening the drop-down list.
Syntax
'Declaration
 
Public Property AutoWidth As Boolean
'Usage
 
Dim instance As ComboDropDownInfo
Dim value As Boolean
 
instance.AutoWidth = value
 
value = instance.AutoWidth
public bool AutoWidth {get; set;}

Property Value

true to calculate the width for the drop-down window, based on the columns and control width, when opening the drop-down; otherwise, false. The default is false.
Remarks

If the drop-down width is set by resizing or by setting the width and height for the drop-down, then the drop-down width does not change.

If AutoWidth is true and Width is set, then the drop-down width is the larger setting (AutoWidth or column width).

If AutoWidth is false and Width is set, then the drop-down width is the larger setting (Width or column width).

Example
This example sets the AutoWidth and Width properties.
GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType gcCom = new GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType();
for (int i = 0; i < 10; i = i + 1)
{
    gcCom.Items.Add("t" + i.ToString());
}
gcCom.ListColumns.Add("Column3");
gcCom.ListColumns.Add("Column4");
gcCom.ListColumns.Add("Column3");
gcCom.ListColumns.Add("Column4");
gcCom.DropDown.Width = 180;
gcCom.DropDown.AutoWidth = false;
fpSpread1.ActiveSheet.Cells[2, 0].CellType = gcCom;
fpSpread1.ActiveSheet.Columns[0].Width = 120;
Dim gcCom As New GrapeCity.Win.Spread.InputMan.CellType.GcComboBoxCellType()
Dim i As Integer = 0
While i < 10
    gcCom.Items.Add("t" + i.ToString())
End While

gcCom.ListColumns.Add("Column3")
gcCom.ListColumns.Add("Column4")
gcCom.ListColumns.Add("Column3")
gcCom.ListColumns.Add("Column4")
gcCom.DropDown.Width = 180
gcCom.DropDown.AutoWidth = False
FpSpread1.ActiveSheet.Cells(2, 0).CellType = gcCom
FpSpread1.ActiveSheet.Columns(0).Width = 120
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ComboDropDownInfo Class
ComboDropDownInfo Members

 

 


Copyright © GrapeCity, inc. All rights reserved.