code_junkie

Get the DefaultView DataRowView from a DataRow

Nov 10th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. row.Table.DefaultView[row.Table.Rows.IndexOf(row)]
  2.  
  3. DataRowView newRowView = null;
  4. foreach (DataRowView tempRowView in myDataTable.DefaultView)
  5. {
  6. if (tempRowView.Row == rowToMatch)
  7. newRowView = tempRowView;
  8. }
  9. if (newRow != null)
  10. UseNewRowView(newRowView);
  11. else
  12. HandleRowNotFound();
Add Comment
Please, Sign In to add comment