Spread Windows Forms 11.0 Product Documentation
GetColumnIndex Method (DefaultSheetDataModel)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > DefaultSheetDataModel Class : GetColumnIndex Method
Column name
Gets the index of the column specified by name.
Syntax
'Declaration
 
Public Function GetColumnIndex( _
   ByVal columnName As String _
) As Integer
'Usage
 
Dim instance As DefaultSheetDataModel
Dim columnName As String
Dim value As Integer
 
value = instance.GetColumnIndex(columnName)
public int GetColumnIndex( 
   string columnName
)

Parameters

columnName
Column name
Example
This example returns the index of the specified column.
FarPoint.Win.Spread.Model.DefaultSheetDataModel dm;
dm = fpSpread1.ActiveSheet.Models.Data;
int i = dm.GetColumnIndex("EmployeeID");
fpSpread1.ActiveSheet.Columns[i].ForeColor = Color.Red;
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
See Also

Reference

DefaultSheetDataModel Class
DefaultSheetDataModel Members