Spread Windows Forms 6.0 Product Documentation
GetColumnIndex Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : GetColumnIndex Method


columnName
Column name

Glossary Item Box

Gets the index of the column specified by name.

Syntax

Visual Basic (Declaration) 
Public Function GetColumnIndex( _
   ByVal columnName As String _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim columnName As String
Dim value As Integer
 
value = instance.GetColumnIndex(columnName)
C# 
public int GetColumnIndex( 
   string columnName
)

Parameters

columnName
Column name

Example

This example returns the index of the specified column.
C#Copy Code
FarPoint.Win.Spread.Model.DefaultSheetDataModel dm;
dm = fpSpread1.ActiveSheet.Models.Data;
int i = dm.GetColumnIndex("EmployeeID");
fpSpread1.ActiveSheet.Columns[i].ForeColor = Color.Red;
Visual BasicCopy Code
Dim dm As FarPoint.Win.Spread.Model.DefaultSheetDataModel
dm = FpSpread1.ActiveSheet.Models.Data
Dim i As Integer = dm.GetColumnIndex("EmployeeID")
FpSpread1.ActiveSheet.Columns(i).ForeColor = Color.Red

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

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