Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2006, 02:32 AM
Registered User
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default VS2005 DataGridViewComboBoxColumn databound

Hi,

i'm trying to learning how to manipulate the DataGridView with database.
So, i added a 2 databasebound DataGridViewComboBoxColumn ("VehicleBrand", "VehicleModel")
so what i want to happen is to make the "VehicleModel" Column dependent on the selection of the "VehicleBrand" column. so, if i chose porsche then the model of porsche would be available in the "VehicleModel" column. and then everything inside the DataGridView will be saved and loaded from the database.
So, how am i suppose to do this?

 
Old October 11th, 2006, 03:31 PM
Authorized User
 
Join Date: May 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to notrosh
Default

How are you loading the data into the gridview?
 
Old October 11th, 2006, 08:14 PM
Registered User
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm planning to use OLEDB for the connection.
I'm still not sure. since i don't know if it would work better using typed dataset or untyped dataset. i'm still doing a lot of research.
and frankly, i'm lost.

So, could give a suggestion to put me in the right direction.?

 
Old October 12th, 2006, 09:04 AM
Authorized User
 
Join Date: May 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to notrosh
Default

I would probably populate a dataset. Then use a dataview to populate the grid. I use the dataview because with a dataview you can use sorting and paging. You can also use the built-in features of the gridview in VS 2005.
As far as the SQL statement I would use. If you are trying to combine two columns in a table then you should use a JOIN statement.

I hope this helps. I will try to put up some code by the end of the day that will show how to bind a datagrid with a join statement.

have a good day

notrosh

www.nwadnug.org
 
Old October 12th, 2006, 06:29 PM
Registered User
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

so the JOIN statement is the key to make the 2 DataGridViewComboBoxColumn work?

I am already able to connect to the database and load it to datagridview using the binding source. the only thing missing is how i am going to make each VehicleModel Cell Row dependent to it's corresponding VehicleBrand Cell row.

is the gridview ur talking about different from the datagridview?

thank you. i'll be waiting for your example codes. :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Databound Dropdown fullingdale ASP.NET 2.0 Basics 2 June 20th, 2008 02:33 AM
DataGridViewComboBoxColumn Jamil.Anwar C# 2005 0 January 11th, 2008 06:22 AM
DataGridViewComboBoxColumn andymann C# 2005 2 June 23rd, 2006 07:17 AM
DataGridViewComboBoxColumn bmains Pro Visual Basic 2005 0 January 5th, 2006 12:30 PM
databound headertemplate collie VB.NET 2002/2003 Basics 0 March 7th, 2005 10:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.