Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 December 3rd, 2007, 04:09 PM
Authorized User
 
Join Date: Dec 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default combobox - Key & Value pair problem

Hi !!

I do windows based database programming using only C# as the front end.

Often i have to populate the comboboxes with data from tables for choosing an item or vendor etc from the list.

The problem is that unlike in asp.net, the C# does not allow me to insert key value pairs in to the comboboxes. As in case of database programming we generally display the descriptions while using the ID internally (like: showing a list of products for selection in the combobox while using the selected product's ID to insert a record in the sales table).

Currently i am using a pair of comboboxes , one to fill the product names and other to fill the product ids. In order to get the ID i use the selected index property of combobox1 to retrieve the ID from combo box 2. But this consumes a lot of resources and is a bit lengthy too. The same thing C# supports it in ASP.Net but not in Windows Programming. Why ? Is there any other alternative ?

Plz Help & Thanks.






dev(1);
__________________
dev(1);
 
Old December 3rd, 2007, 04:22 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

This might help you
http://metadeveloper.blogspot.com/20...-itemdata.html

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 3rd, 2007, 04:53 PM
Authorized User
 
Join Date: Dec 2007
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi!

That was an excellent document !

Thank you very much. You people are really doing a nice job.

Hats off to you all.... and keep it up.





Quote:
quote:Originally posted by dparsons
 This might help you
http://metadeveloper.blogspot.com/20...-itemdata.html

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
dev(1);





Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagridview & combobox column p2pmarit .NET Framework 2.0 1 July 31st, 2006 02:31 AM
ComboBox & Named Range bahachin Excel VBA 2 June 13th, 2006 12:59 PM
comboBox & ReadOnly melvik C# 12 February 12th, 2004 01:50 PM
comboBox & ReadOnly melvik C# 2 October 29th, 2003 12:45 AM





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