Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Gridview view issue
 

Gridview view issue

I need to implement the parent child relation into the single datagirdview row.
This row contains the "+" sign if it contains the child data, when user will click on this "+" sign it will expand the another child grid from that selected datagridview row.

I am using vs 2008.

Thanks in advance.

Ashlesh

Regards Ashlesh,
Ashlesh Patel  Monday, March 16, 2009 5:41 AM
I need to implement this without using any third party controls.

Thanks.

Ashlesh

Regards Ashlesh,
Ashlesh Patel  Monday, March 16, 2009 5:41 AM
Hi Ashlesh Patel,

The new DataGridView control doesn't support this. You may need to use the Old DataGrid control. You canfind the code in the FAQ here.
If you have any doubts, please feel free to let me know.

Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Tuesday, March 17, 2009 5:21 AM
Hi Bruce,

Thank you for the reply,
Your provided information is very useful to me. But I can not access the sample code link which you had provide me.

Regards Ashlesh,
Ashlesh Patel  Tuesday, March 17, 2009 8:43 AM
Hi Ashlesh,

Sorry, I wasn't aware the link in the FAQ is invalid now. However, there're some VB.NET code in the link. You can try to download the sample project here.

If there's still any problem, please feel free to let me know.

Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Tuesday, March 17, 2009 8:57 AM
Hi Bruce,

Your post is very helpful to me to understand the grid.
But my issues is to open the child grid into the parent gird row. This parent grid row (if contains the child data then and only then) display with the "+" sign.

Any help will be appreciable.

Regards Ashlesh,
Ashlesh Patel  Tuesday, March 17, 2009 11:23 AM

You can add a DataGridView to the Control collection of the parent DataGridView, and show or hide it when you click "+" sign. Also need to adjust the location of the childDataGridView according to the row in the parent DataGridView.


Best regards,
Bruce Zhou


Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Tuesday, March 17, 2009 11:58 AM
Hi Bruce,

I have already tried it with your suggestion, but I think vs2008 is only providing textbox column, combobox column, link column, image column and button column for the gridview's particular control container collection.

Regards Ashlesh,
Ashlesh Patel  Wednesday, March 18, 2009 6:35 AM
Hi Ashlesh Patel,

Maybe I'm not clear enough. I didn't mean that we need to add the DataGridView as a column to the column collection of the DataGridView. But just add the DataGridView to the control collection of the DataGridView. Like the following:

this.dataGridView1.controls.add(this.dataGridView2);

Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Wednesday, March 18, 2009 6:47 AM
Hi Ashlesh Patel,

How's your problem now? If you have any doubts regarding to my suggestion, please feel free to let me know.


Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Friday, March 20, 2009 1:29 AM
We are changing the issue type to “General Discussion�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by opening the Options list at the top of the post editor window, and changing the type. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Monday, March 23, 2009 2:51 AM

You can use google to search for other answers

Custom Search

More Threads

• Children of a control incorrectly respond to the mouse popup menu interaction during design time.
• How can I add my custom control the DataSource properties
• how to close window in this way ...
• There is already a command handler for the menu command '5efc7975-14bc-11cf-9b2b-00aa00573819 : 17'
• all the controls in current tabpage disapear after setting a textbox text property to be bound to an application settings.
• DataGridView DisplayIndex doesn't keep positions
• Control sizes shink after opened from saved xml for .net 2003
• Help with Custom Form Design(NicePanel ) Problems
• How to trap the mouse events (move, hover, etc) for the designerhost?
• Populating the treeview with directory details