DataRowView.Row 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得正在檢視的 DataRow。
public:
property System::Data::DataRow ^ Row { System::Data::DataRow ^ get(); };
public System.Data.DataRow Row { get; }
member this.Row : System.Data.DataRow
Public ReadOnly Property Row As DataRow
屬性值
正在由 DataRow 檢視的 DataRowView。
範例
下列範例會 Row 使用 屬性來列印 中每個修改數據列中 DataView第三欄的值。
private void ShowColumn3()
{
DataView view = (DataView) dataGrid1.DataSource;
// Set the filter to display only those rows that were modified.
view.RowStateFilter=DataViewRowState.ModifiedCurrent;
// Change the value of the CompanyName column for each modified row.
foreach(DataRowView rowView in view)
{
Console.WriteLine(rowView.Row[2]);
}
}
Private Sub ShowColumn3()
Dim view As DataView = CType(dataGrid1.DataSource, DataView)
' Set the filter to display only those rows that were modified.
view.RowStateFilter = DataViewRowState.ModifiedCurrent
' Change the value of the CompanyName column for each modified row.
Dim rowView As DataRowView
For Each rowView In view
Console.WriteLine(rowView.Row(2))
Next rowView
End Sub