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


viewRow
Row index in the sheet
modelRow
Row index in the data model

Glossary Item Box

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

Syntax

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

Parameters

viewRow
Row index in the sheet
modelRow
Row index in the data model

Return Value

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

Exceptions

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

Example

This example sets the model row index in the data model that corresponds to the specified view row index on the sheet.
C#Copy Code
private void fpSpread1LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
{
      int i;
      i = fpSpread1.ActiveSheet.SetModelRowForViewRow(e.Row, 1);
      MessageBox.Show("The previous model row index mapped to the specified view row 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.SetModelRowForViewRow(e.Row, 1)
      MessageBox.Show("The previous model row index mapped to the specified view row is row " & i.ToString())
End Sub

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

Reference

SheetView Class
SheetView Members

User-Task Documentation

Using Sheet Models

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