Spread Windows Forms 7.0 Product Documentation
SetModelColumnForViewColumn Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SetModelColumnForViewColumn Method


viewColumn
Column index in the sheet
modelColumn
Column index in the data model

Glossary Item Box

Sets the column index in the data model that corresponds to the specified column index in the sheet.

Syntax

Visual Basic (Declaration) 
Public Overridable Function SetModelColumnForViewColumn( _
   ByVal viewColumn As Integer, _
   ByVal modelColumn As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim viewColumn As Integer
Dim modelColumn As Integer
Dim value As Integer
 
value = instance.SetModelColumnForViewColumn(viewColumn, modelColumn)
C# 
public virtual int SetModelColumnForViewColumn( 
   int viewColumn,
   int modelColumn
)

Parameters

viewColumn
Column index in the sheet
modelColumn
Column index in the data model

Return Value

Integer previous column index in the data model that is mapped to the specified column index in the sheet

Exceptions

ExceptionDescription
System.ArgumentOutOfRangeException Specified column in the sheet is out of range; must be between -1 and the total number of columns in the sheet
System.ArgumentOutOfRangeException Specified column in the model is out of range; must be between -1 and the total number of columns in the model

Example

This example sets the model column index in the data model that corresponds to the specified view column index on the sheet.
C#Copy Code
private void fpSpread1LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
{
      int i;
      i = fpSpread1.ActiveSheet.SetModelColumnForViewColumn(e.Column, 1);
      MessageBox.Show("The previous model column index mapped to the specified view column is row " + i.ToString());
}
Visual BasicCopy Code
Private Sub FpSpread1LeaveCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Handles FpSpread1.LeaveCell
      Dim i As Integer
      i = FpSpread1.ActiveSheet.SetModelColumnForViewColumn(e.Column, 1)
      MessageBox.Show("The previous model column index mapped to the specified view column is row " & i.ToString())
End Sub

Requirements

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

See Also

Reference

SheetView Class
SheetView Members

User-Task Documentation

Using Sheet Models

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