FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SetColumnWidth Method |
This is equivalent to the SheetView.SetColumnWidth method. For more information on setting the size of the column, refer to Setting the Row Height or Column Width.
Column widths can be based on the data in the cells using the GetPreferredWidth method or SheetView.GetPreferredColumnWidth method. For more information, see Resizing the Row and Column to Fit the Data.
You can allow users to resize columns by setting the Resizable property. If the user is allowed to resize columns, when the user resizes a column, the FpSpread.ColumnWidthChanged and SheetView.ColumnChanged events occur.
fpSpread1.ActiveSheet.SetColumnWidth(0, 120);
int i;
i = fpSpread1.ActiveSheet.GetColumnWidth(0);
listBox1.Items.Add(i.ToString());
FpSpread1.ActiveSheet.SetColumnWidth(0, 120) Dim i As Integer i = FpSpread1.ActiveSheet.GetColumnWidth(0) ListBox1.Items.Add(i.ToString())
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8