How do I create a Master Detail Form with DataGridView
For anyone else looking for a way to use DataGridView in the same way it would appear in Microsoft Access, This is what I've come up with just as a guide..
From what I've been reading, the closest thing that can be used in .NET to do this is ASP.NET since its more likely to be done as a web component..
So what I'm going to do is this. Using One DataGridView on my Main Form, I'm going to use code to resize the Row Size when I've clicked on a particular row. i.e. Make the Row Get Taller/Longer,
Then use code to place another DataGridView, "the child" inside of a panel that is minimised and hidden on my Master Form.
This Child DataGridView inside of the Second Panel, will then be placed withing the Space of the Heightened Row that was selected..
I'll post the Code fragments when I'm done so far Im gona test this code for the row resizing
For anyone else looking for a way to use DataGridView in the same way it would appear in Microsoft Access, This is what I've come up with just as a guide..
From what I've been reading, the closest thing that can be used in .NET to do this is ASP.NET since its more likely to be done as a web component..
So what I'm going to do is this. Using One DataGridView on my Main Form, I'm going to use code to resize the Row Size when I've clicked on a particular row. i.e. Make the Row Get Taller/Longer,
Then use code to place another DataGridView, "the child" inside of a panel that is minimised and hidden on my Master Form.
This Child DataGridView inside of the Second Panel, will then be placed withing the Space of the Heightened Row that was selected..
I'll post the Code fragments when I'm done so far Im gona test this code for the row resizing
VB.NET:
Private Sub DataGridView1_CellPainting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
If e.RowIndex > -1 Then
DataGridView1.Rows(e.RowIndex).Height = 35
End If
End Sub