Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for DataGridView tutorial 2

Status
Not open for further replies.

emaduddeen

Programmer
Mar 22, 2007
184
0
0
US
Hi Everyone,

I guess you know from my few posts that I'm new to Visual Basic 2008.

I'm looking for a tutorial that show me how to joint 2 separate DataGridView's on a single form.

I would like to joint them in a parent child way. I have been able to set up each one to a database table, but I don't know how to synchronize the 2 of them so if the user highlights a different row on the parent one the child one refreshes to show only child rows to match the database relationship.

If there is no tutorial or book can you tell me how to do this?

Thanks.

Truly,
Emad
 
Microsoft has some great VB how-to-videos at
take a look at the "Forms over Data Video Series" specifically "#3 | How Do I: Create a One-to-Many Data Entry Form?"

If I recall this video is for setting up a form as the parent and with a child datagridview. The concept is the same if you want to set up two datagridview with one as the parent and the other as the child

It's really not too difficult if things are set up correctly, as RiverGuy says it's not so much a datagridview issue as it is a datarelations issue.
 
If memory serves correctly, the DataGrid control has Parent/Child functionality built into it.

By default this control is not added to the ToolBox in VS 2005 and VS 2008, you will have to add it manually. To do this, use the same principle as in my reply to your other post. However, you will need to select the .NET Framework Components tab from the Dialog Box. You will probably see several DataGrid references (some for Compact Framework or WebForms which will already have been selected - these will only show in the ToolBox if you are developing an appropriate type of application). You will need to select the one which has System.Windows.Forms (2.0.0.0) as its Assembly Name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top