Spread Windows Forms 7.0 Product Documentation
PreviewRowFetchEventArgs Constructor
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > PreviewRowFetchEventArgs Class : PreviewRowFetchEventArgs Constructor


spreadView
The SpreadView.
row
The row index.
previewRowContent
The preview row content.

Glossary Item Box

Initializes a new instance of the PreviewRowFetchEventArgs class.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal spreadView As SpreadView, _
   ByVal row As Integer, _
   ByVal previewRowContent As String _
)
Visual Basic (Usage)Copy Code
Dim spreadView As SpreadView
Dim row As Integer
Dim previewRowContent As String
 
Dim instance As New PreviewRowFetchEventArgs(spreadView, row, previewRowContent)
C# 
public PreviewRowFetchEventArgs( 
   SpreadView spreadView,
   int row,
   string previewRowContent
)

Parameters

spreadView
The SpreadView.
row
The row index.
previewRowContent
The preview row content.

Example

This example uses the PreviewRowFetch event.
C#Copy Code
private void Form1_Load(object sender, EventArgs e)
{
FarPoint.Win.BevelBorder bord = new FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.Red, Color.Blue);
fpSpread1.Sheets[0].Cells[0, 1, 10, 1].Text = "Preview Row";
fpSpread1.Sheets[0].PreviewRowInfo.Visible = true;
fpSpread1.Sheets[0].PreviewRowInfo.BackColor = Color.BurlyWood;
fpSpread1.Sheets[0].PreviewRowInfo.ForeColor = Color.Black;
fpSpread1.Sheets[0].PreviewRowInfo.Border = bord;
}

private void fpSpread1_PreviewRowFetch(object sender, FarPoint.Win.Spread.PreviewRowFetchEventArgs e)
{
  FarPoint.Win.Spread.SheetView sheetView = e.View.GetSheetView();
  if (sheetView.SheetName == "Sheet1")
  {
    if (e.PreviewRowContent == string.Empty)
      e.PreviewRowContent = "The preview row content is empty";
    if ((e.Row + 1) % 2 == 0)
      e.PreviewRowContent = string.Format("Preview Row Content is: {0}", e.PreviewRowContent);
  }
}
Visual BasicCopy Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim bord As New FarPoint.Win.BevelBorder(FarPoint.Win.BevelBorderType.Raised, Color.DarkBlue, Color.Blue)
FpSpread1.Sheets(0).Cells(0, 1, 10, 1).Text = "Preview Row"
FpSpread1.Sheets(0).PreviewRowInfo.Visible = True
FpSpread1.Sheets(0).PreviewRowInfo.BackColor = Color.BurlyWood
FpSpread1.Sheets(0).PreviewRowInfo.ForeColor = Color.Black
FpSpread1.Sheets(0).PreviewRowInfo.Border = bord
End Sub

Private Sub FpSpread1_PreviewRowFetch(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PreviewRowFetchEventArgs) Handles FpSpread1.PreviewRowFetch
        Dim sheetView As FarPoint.Win.Spread.SheetView
        sheetView = e.View.GetSheetView()
        If sheetView.SheetName = "Sheet1" Then
            If (e.PreviewRowContent = String.Empty) Then
                e.PreviewRowContent = "The preview row content is empty"
            End If
            If ((e.Row + 1) / 2 = 0) Then
                e.PreviewRowContent = String.Format("Preview Row Content is: {0}", e.PreviewRowContent)
            End If
        End If
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

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