Reputation: 8984
If anyone's used Access recently, you might recall that when it displays data for a table that has a relationship, a little expandable node appears next to each row. Clicking on it shows all of the data from other tables related to that row in-line, underneath the row.
I basically want to do that in .Net. Is this something I can do using a DataGridView, which I'm already using, or do I need to build/buy something?
Upvotes: 2
Views: 708
Reputation: 53593
The DataGridView from .NET 2.0+ doesn't show child records like Access. However, the .NET 1.x DataGrid control does. You can use this in your project.
You may also wish to check this out: Customizing the DataGridView to support expanding/collapsing (ala TreeGridView)
Edit: One thing I'll add. When I was investigating this issue for a .NET 2.0 application I was writing I was going to use a .NET 1.1 DataGrid for this functionality. I also looked into alternatives (like the component I linked above) but in the end decided not to complicate things and went with two DataGridViews linked in a master-detail relationship.
How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls
Upvotes: 2