Child/Parent DataGridViews Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    #1

    Child/Parent DataGridViews Question

    I have two datagridviews on a form that are linked via a
    datarelation. I am using:
    "foreach ( DataGridViewRow tripRow in
    scenario_TripsD ataGridView.Row s )"
    to loop thru all the rows in the parent datagridview. For each
    parent row I want to get values out of each child datagridview row
    also. The child datagridview has DataGridViewCom boBoxColumn columns
    that I want to get the formatedvalue from so I do not want to get data
    from the datarow, which is all that I have been able to do so far
    using the following code:
    DataRow dr = ( tripRow.DataBou ndItem as DataRowView ).Row;

    foreach (DataRow child in
    dr.GetChildRows (this.dsShipSch eduler.Relation s["FK_Trip_Produc ts_Scenario_Tri ps"]))

    How can I get the datagridview rows for the child rows for each parent
    row?
Working...