Spread for ASP.NET 7.0 Product Documentation
GetColumnWidth Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : GetColumnWidth Method


column
Column index

Glossary Item Box

Gets the width of the specified column in pixels.

Syntax

Visual Basic (Declaration) 
Public Function GetColumnWidth( _
   ByVal column As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim column As Integer
Dim value As Integer
 
value = instance.GetColumnWidth(column)
C# 
public int GetColumnWidth( 
   int column
)

Parameters

column
Column index

Return Value

Integer number of pixels in the column width

Remarks

To specify the width for a column, use the SetColumnWidth method.

Note: The value returned by the this method does not include the width of the adjacent grid line.

The default width for columns in the sheet is determined by the DefaultColumnWidth property.

If you prefer, you can allow users to resize columns by using the SetColumnSizeable method.

To see the height for a row, use the GetRowHeight method.

Example

This example creates a SheetView object and a Column object. Values are inserted into the second column and the column width is adjusted so all of the text is visible. The width of the column is returned to a list box using the SheetView object.
C#Copy Code
FarPoint.Web.Spread.SheetView sv=FpSpread1.ActiveSheetView;
FarPoint.Web.Spread.Columnmycol;
mycol=sv.Columns[1];
mycol.Width=160;
sv.SetValue(0,1,"Tire/Wheel Alignment");
sv.SetValue(1,1,"Fuel Injectors Cleaned");
sv.SetValue(2,1,"Brakes Adjusted");
ListBox1.Items.Add(Convert.ToString(sv.GetColumnWidth(1)));
Visual BasicCopy Code
Dim sv As FarPoint.Web.Spread.SheetView
sv=FpSpread1.ActiveSheetView
Dim mycol A sFarPoint.Web.Spread.Column
mycol=sv.Columns(1)
mycol.Width=160
sv.SetValue(0,1,"Tire/Wheel Alignment")
sv.SetValue(1,1,"Fuel Injectors Cleaned")
sv.SetValue(2,1,"Brakes Adjusted")
ListBox1.Items.Add(sv.GetColumnWidth(1))

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.