Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Nested datagrid views?
 

Nested datagrid views?

I'd like to nest a datagrid view insidea column of another datagridview. Is this possible using the standard functionality exposed by Visual Basic 2008 Express?

If not, is anyone aware of any free third party control that implements this functionality?
I know both infragistics and devexpress have such controls, but they're bundled with a load of other stuff that I don't need, and they don't come cheap.


I can nest html tablesand load them into my form using a webbrowser control, but that wouldn't serve my other purpose, which is, I want the users to be able to navigate through the rows one at a time using the up and down arrow keys (not between rows of the inner nested table, only between the outer table's rows),which is not possible using html tables.
Anyone have any good ideas?
reachrishikh  Monday, February 02, 2009 7:41 PM
Allright, to anyone who is looking for a solution to this very problem,
I have found an answer and am on the verge of breakthrough of achieving a nested datagridviewin this thread -
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/0a63a483-5b15-40d6-afb4-8add6b4f244f
reachrishikh  Friday, March 06, 2009 9:28 AM

Hi reachrishikh,

Do you mean a master-details DataGridView? When you click a cell of a special, it will popup a DataGridView with the detail items related to the item in that cell?

If so, please look at this FAQ. http://windowsclient.net/blogs/faqs/archive/2006/07/10/how-do-i-show-master-details.aspx

If I misunderstood something, please feel free to tell me.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Wednesday, February 04, 2009 7:49 AM

No, I don't mean that when you click aparticular cell, it will popup another datagridview with the detail items underneath it (like in MS Access)

The nested datagridview stays there all the time.

I'm trying to achieve this look, but with nested datagridviews. Please save the code as an html file and open it with your browser.

<html>
<head>
<title>Test</title>
</head>
<body>
<tableborder="1">
<colwidth="20"/>
<colwidth="50"/>
<colwidth="100"/>
<colwidth="400"/>
<ahref="page2.html">
<trvalign="top">
<td>01
</td>
<td>Data1
</td>
<td>Somedata1
</td>
<td>
<tableborder="1">
<colwidth="250"/>
<colwidth="75"/>
<colwidth="75"/>
<tr>
<td>Somemoredata1
</td>
<td>Somefigures1
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>Somemoredata2
</td>
<td>&nbsp;
</td>
<td>Somefigures2
</td>
</tr>
</table>
</td>
</tr>
</a>
<ahref="page3.html">
<trvalign="top">
<td>02
</td>
<td>Data2
</td>
<td>Somedata2
</td>
<td>
<tableborder="1">
<colwidth="250"/>
<colwidth="75"/>
<colwidth="75"/>
<tr>
<td>Somemoredata3
</td>
<td>Somefigures3
</td>
<td>&nbsp;
</td>
</tr>
<tr>
<td>Somemoredata4
</td>
<td>&nbsp;
</td>
<td>Somefigures4
</td>
</tr>
<tr>
<td>Somemoredata5
</td>
<td>&nbsp;
</td>
<td>Somefigures5
</td>
</tr>
</table>
</td>
</tr>
</a>
<table>
reachrishikh  Wednesday, February 04, 2009 10:40 AM

Hi reachrishikh,

As far as I know DataGridView doesn't offer such kind of function. If you want to imitate it, you need to create a Borderless form and host a DataGridView in it. When you click the cell, popup that form with the detail information shown in the DataGridView hosted in that form.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Thursday, February 05, 2009 2:21 AM
Thanks but popping up isn't an option for me. I have to show the entire data at one go.
I'm trying to look into this other option suggested to me though.
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/0a63a483-5b15-40d6-afb4-8add6b4f244f

Anyway, do you know how I can get the datagrid control to show up in my toolbox in Visual Basic 2008 Express? I've heard that you can nest datagrids inside datagrids, but as of now I can only create datagrids programmatically. I want to create one using the designer as well.
reachrishikh  Thursday, February 05, 2009 7:59 AM
I'm not sure if you're trying to use a webforms app or a windows app? but If you're trying for a winforms app, try getting hold of devExpress. It contains a datagrid control with which you can nest multiple grid views...

As for the web forms app, I have a sample at home on how to nest grid views. If that's what you're looking for I'll go thru the effort of finding it and posting it up here
koenyn  Monday, February 16, 2009 11:02 AM
Hi koenyn,
Thanks for the help.

I'm using a windows app, not a webforms app. As I've already mentioned above, going the devExpress route would be too expensive for me.
reachrishikh  Monday, February 16, 2009 3:16 PM
Allright, to anyone who is looking for a solution to this very problem,
I have found an answer and am on the verge of breakthrough of achieving a nested datagridviewin this thread -
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/0a63a483-5b15-40d6-afb4-8add6b4f244f
reachrishikh  Friday, March 06, 2009 9:28 AM

You can use google to search for other answers

Custom Search

More Threads

• Custom Controls with Visual C++ .NET
• Problems with localized UserControl
• How to set location of minimized mdi child form?
• To Provide A Flat look for NumericUpDown[urgent]
• design at runtime on panel
• layout components when resizing
• Designer Background
• The type or namespace name IDump,TextProperty,RemoteFilePathProperty,SourceFileproperty,TransferPorotocolProperty,ValidityCheck,DestinationFileProperty could not be found (are you missing a using directive or an assembly
• Is there anyway to set the width of a textbox according to its maxlength property???
• how to get selected record in datagrid