Get DataGridView.SelectedRows Children Data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cday119
    New Member
    • Mar 2008
    • 29

    Get DataGridView.SelectedRows Children Data

    Hi All,

    I have a datagridview, and I'm looping threw the selected rows like so:

    Code:
    For Each row As System.Windows.Forms.DataGridViewRow In OrderDataGridView.SelectedRows
    This DataGridView Holds Order Information and it contains a column called ShippingID, which is used as a foreign key relation to another table(ShippingA ddress) in the DataSet.

    My question is how to I access the related ShippingAddress data? Basically I want to do something like this:

    Code:
    For Each row As System.Windows.Forms.DataGridViewRow In OrderDataGridView.SelectedRows
    
    OrderdID = row.cells(1)
    ShippingAddress1 = row.relatedtable.item("ShippingAddress1")
    
    Next
    Thanks
    Chad
Working...