How does datagridview handle "Master / Detail"?
In .net objects like DataTable when you have two grids(Master and Detail) and add a row to the second one(Detail), The new row will have the Foreign-Key Values automatically.
How 开发者_C百科can i do it(I don't use DataTables because they suck)? thanks.Here are some articles/papers on how Master-Detail relationship can be implememted with business objects(classes):
http://www.codeproject.com/KB/grid/Bindinglist.aspx
http://msdn.microsoft.com/en-us/library/aa581795.aspx
bind the two grids to the respective master/detail database tables and set the corresponding primary/foreign key fields using the DataKeyNames attributes
精彩评论