Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 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 September 29th, 2004, 02:25 PM
Authorized User
 
Join Date: Jun 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo box with different display and send values

Hi all,
 I know it is really silly question but i couldnt find the answer in the book i have and on internet as well.
 i am designing a windows application and i am using combo box at few places. Now what i want to do is to display the description of the options to the user but when user hits save button i want only the codeId of that option to be sent to the database.
 I know how to do it in asp but vb .net is new for me.
i hope some one will help
thanks in advance

__________________
------------------------
http://www.indrajal.com
 
Old October 10th, 2004, 12:41 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have two proprties in ComboBox namely "DisplayMember" and "ValueMember". DisplayMember can be used to display the values to the user and the "ValueMember" is the value returned when the user selects that particular value from the ComboBox.

Also you can use DataBinding if you are getting value for the TextBox from the DataBase.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old October 14th, 2004, 12:30 PM
Authorized User
 
Join Date: Jun 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pradeep_itguy
 You have two proprties in ComboBox namely "DisplayMember" and "ValueMember". DisplayMember can be used to display the values to the user and the "ValueMember" is the value returned when the user selects that particular value from the ComboBox.

Also you can use DataBinding if you are getting value for the TextBox from the DataBase.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
Thanks for the reply.
but i dont know how to set two different values for a list of values in the combobox. when i click collection button i can only type text in a text box, where can i write the display and valuemember for each option?
BTW when i click on display and value member property of the combobox i only see a cross sign.
also i am not using database to populate the comboboxes.
thanks again your help and looking forward to getting the answer.
 
Old November 9th, 2004, 12:34 PM
Authorized User
 
Join Date: Jun 2004
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured it out. Here is a helpful article;

http://www.vb-helper.com/howto_net_bound_combobox.html






Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
values in combo box Vince_421 Access VBA 8 May 10th, 2007 08:46 AM
combo box saves Number of Values JpaulH Access VBA 2 May 3rd, 2006 06:55 AM
Testing for NULL Values in a Combo Box Aaron Edwards Access 2 September 28th, 2005 09:37 AM





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