P
priyanka
Hi All,
I am trying to display parent child records in two separate datagrids.
The 2 tables have the relationship set in the dataset. I bind the
datagrid using the relationship names, so that when a parent record is
selected in the first grid, the corresponding child records are
displayed in the second grid automatically.
I set the relationship in the dataset in a separate class and the
binding in another class. I am not able to get the second grid to
display child records automatically corresponding to the parent. I hav
pasted my code below. Any help would be great!
Thanks
Public Class GenreData
......
......
Public Function GetGenreFromSql()
'Add relationships between tables
genreDS.Relations.Add("genre2Stations",
GenreData.genreDS.Tables(GENRE_TBL).Columns("genre_no"),
_
GenreData.genreDS.Tables(STATION_TBL).Columns("genre_no"))
End function
end class
public class DataGridPopulator
public function BindGrid(byref tmpGrid as datagrid)
tmpGrid.SetDataBinding(GenreData.genreDS,
"genre_tbl.genre2Stations")
end function
end class
I am trying to display parent child records in two separate datagrids.
The 2 tables have the relationship set in the dataset. I bind the
datagrid using the relationship names, so that when a parent record is
selected in the first grid, the corresponding child records are
displayed in the second grid automatically.
I set the relationship in the dataset in a separate class and the
binding in another class. I am not able to get the second grid to
display child records automatically corresponding to the parent. I hav
pasted my code below. Any help would be great!
Thanks
Public Class GenreData
......
......
Public Function GetGenreFromSql()
'Add relationships between tables
genreDS.Relations.Add("genre2Stations",
GenreData.genreDS.Tables(GENRE_TBL).Columns("genre_no"),
_
GenreData.genreDS.Tables(STATION_TBL).Columns("genre_no"))
End function
end class
public class DataGridPopulator
public function BindGrid(byref tmpGrid as datagrid)
tmpGrid.SetDataBinding(GenreData.genreDS,
"genre_tbl.genre2Stations")
end function
end class