Spread ASP.NET 6.0 Product Documentation
GetDataRow Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : GetDataRow Method


row
Row index

Glossary Item Box

Gets the view of a specified row of data.

Syntax

Visual Basic (Declaration) 
Public Function GetDataRow( _
   ByVal row As Integer _
) As DataRowView
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim row As Integer
Dim value As DataRowView
 
value = instance.GetDataRow(row)
C# 
public DataRowView GetDataRow( 
   int row
)

Parameters

row
Row index

Return Value

DataRowView object containing the view of row of data

Remarks

For more information about the DataRowView object, refer to the Micorosft .NET Framework Reference.

Example

This example attaches a DataTable to a DefaultSheetDataModel, which is then assigned to the DataModel of the spreadsheet. The DataRow, DataTable and DataView are returned to a list box.
C#Copy Code
 private void Page_Load(object sender, System.EventArgs e)
   {
   if (this.IsPostBack) return;

   DataTable dt = new DataTable("FarPoint");
   dt.Columns.Add("Product");
   dt.Rows.Add(new Object[] {"Spread"});
   dt.Rows.Add(new Object[] {"Input Pro"});
   DataRow nrow;
   nrow = dt.NewRow();
   nrow["Product"] = "To Be Announced";
   dt.Rows.Add(nrow);
   dt.AcceptChanges();
   FarPoint.Web.Spread.Model.DefaultSheetDataModel dm = new FarPoint.Web.Spread.Model.DefaultSheetDataModel(dt);
   FpSpread1.ActiveSheetView.DataModel = dm;
   FpSpread1.ActiveSheetView.Columns[0].Width = 240;
   DataRowView drv;
   DataView dv;
   drv = dm.GetDataRow(1);
   dv = dm.GetDataView();
   ListBox1.Items.Add(Convert.ToString(drv.RowVersion));
   ListBox1.Items.Add(Convert.ToString(dm.GetDataTable()));
   ListBox1.Items.Add(Convert.ToString(dv.Count));
 }
Visual BasicCopy Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

   If (Me.IsPostBack) Then Return

   Dim dt As New DataTable("FarPoint")
   dt.Columns.Add("Product")
   dt.Rows.Add(New Object() {"Spread"})
   dt.Rows.Add(New Object() {"Input Pro"})
   Dim nrow As DataRow
   nrow = dt.NewRow()
   nrow("Product") = "To Be Announced"
   dt.Rows.Add(nrow)
   dt.AcceptChanges()
   Dim dm As FarPoint.Web.Spread.Model.DefaultSheetDataModel = New FarPoint.Web.Spread.Model.DefaultSheetDataModel(dt)
   FpSpread1.ActiveSheetView.DataModel = dm
   FpSpread1.ActiveSheetView.Columns(0).Width = 240
   Dim drv As DataRowView
   Dim dv As DataView
   drv = dm.GetDataRow(1)
   dv = dm.GetDataView()
   ListBox1.Items.Add(drv.RowVersion.ToString())
   ListBox1.Items.Add(dm.GetDataTable.ToString)
   ListBox1.Items.Add(dv.Count.ToString)

 End Sub

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.