-
Apr 13th, 2010, 10:00 PM
#1
Thread Starter
Lively Member
how to display two column value in combobox DisplayMember
hi i'm having hard time on how to display two column values in combox display member..like custID and custName...any sample code plz help
-
Apr 13th, 2010, 10:15 PM
#2
Re: how to display two column value in combobox DisplayMember
That's because it's not possible. If you want to display multiple columns then you have to derive your own class and add that functionality. There are various examples on the web. Search for multicolumn combobox or the like and you'll find them.
-
Apr 13th, 2010, 10:49 PM
#3
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
Any sample code sir please!! So that i have a guide
-
Apr 13th, 2010, 11:03 PM
#4
Re: how to display two column value in combobox DisplayMember
I have no code examples. To find examples, I would have to search the web. You can do that just as easily as I can. They are out there because I've seen them before. Did you try at all?
-
Apr 14th, 2010, 12:11 AM
#5
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
Yeah but it seem i havnt find the right way..just give me that link sir please
-
Apr 14th, 2010, 12:33 AM
#6
Re: how to display two column value in combobox DisplayMember
Originally Posted by crisjala
Yeah but it seem i havnt find the right way..just give me that link sir please
What link? I already said that I didn't have any. All I can do is search, the same as you. Are you saying that you don't know how to search Google?
http://lmgtfy.com/?q=multicolumn+combobox+.net
-
Apr 14th, 2010, 12:15 AM
#7
Junior Member
Re: how to display two column value in combobox DisplayMember
-
Apr 14th, 2010, 12:43 AM
#8
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
Tnx ive seen it but
i dont know the firstep on how to do this
-
Apr 14th, 2010, 12:51 AM
#9
Re: how to display two column value in combobox DisplayMember
Did you download the source files? Did you download the demo project?
-
Apr 14th, 2010, 01:05 AM
#10
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
-
Apr 14th, 2010, 01:19 AM
#11
Re: how to display two column value in combobox DisplayMember
Originally Posted by crisjala
Yes sir
Then you already have everything you need. Import the class into your own project and away you go.
-
Apr 14th, 2010, 01:19 AM
#12
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
Please give me the step of the process multicolumcombobox class...please
-
Apr 14th, 2010, 02:03 AM
#13
Re: how to display two column value in combobox DisplayMember
Can't you just combine your two columns in your sql and set it as the DisplayMember?
Code:
SELECT Column1 + ' ' + Column2 FROM table
-
Apr 14th, 2010, 02:51 AM
#14
Thread Starter
Lively Member
Re: how to display two column value in combobox DisplayMember
TNX BUT THAT NOT WHAT I WANT TO DO
THIS SOMETHING THAT I WANT TO TO DO IN THIS EXAMPLE http://www.codeproject.com/KB/combob...lumncombo.aspx BUT I DONT UNDERSTAND THE PROCESS OR STEP PROCESS
-
Apr 8th, 2011, 11:29 AM
#15
Re: how to display two column value in combobox DisplayMember
Originally Posted by crisjala
YELLING will get you less help. Not more.
Edit: I just realized Weax bumped a year old thread. I doubt the OP is following it anymore.
Last edited by Lord_Rat; Apr 8th, 2011 at 11:34 AM.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Apr 8th, 2011, 11:17 AM
#16
New Member
Re: how to display two column value in combobox DisplayMember
@dee-u, That’s too cool man thanks that will help a lot on other projects as well. @crisjala, some times the best way to learn is not to be given the answer but close that will help you not only find the answer but strengthen you over all knowledge. but if you must here is my code based on the cluse dee-u sugested and it works perfect.
Code:
SELECT first_name1 + ' ' last_name2 AS full_name FROM table
Code:
me.combobox1.displaymember = full_name
works like a charme
thank dee-u
-
May 2nd, 2012, 11:16 AM
#17
New Member
Re: how to display two column value in combobox DisplayMember
Originally Posted by weax1569
@dee-u, That’s too cool man thanks that will help a lot on other projects as well. @crisjala, some times the best way to learn is not to be given the answer but close that will help you not only find the answer but strengthen you over all knowledge. but if you must here is my code based on the cluse dee-u sugested and it works perfect.
Code:
SELECT first_name1 + ' ' last_name2 AS full_name FROM table
Code:
me.combobox1.displaymember = full_name
works like a charme
thank dee-u
I've been hunting for a solution to accomplish this as well. Thanks guys!
-
May 9th, 2016, 01:57 AM
#18
Re: how to display two column value in combobox DisplayMember
i searched the internet, and got to this thread...... what is point of coming to vbforums if people tell you 'go google it'
-
May 9th, 2016, 02:22 AM
#19
Re: how to display two column value in combobox DisplayMember
Originally Posted by schoemr
i searched the internet, and got to this thread...... what is point of coming to vbforums if people tell you 'go google it'
Firstly, you shouldn't be posting on VBForums if you haven't already Googled it, which happens quite regularly. Secondly, I didn't just tell anyone to Google it. I told them what to Google and it was something they weren't aware of before, so the point to coming here would have been to find out what search terms to use. I know that those search terms do work to find relevant information because I've used them before myself but I'm not about to actually do a search for someone who is just as capable of doing it for themselves. If you asked someone on the street how to get to a place you didn't know, would you find it unacceptable for them to do anything but drive you there themselves or would you consider their giving you directions to be helpful? Maybe consider the fact that we all volunteer our time here and there are times that we consider it a waste of that time to reproduce something that we know is already out there and can be found in about 20 seconds. Does that answer your question?
Just to confirm that things haven't changed in the last few years, I took the 20 seconds to search the web and, indeed, the relevant results are still out there and easy to find when the appropriate keywords are used. What's the point of there being a search engine if you don't bother to use it properly?
-
May 9th, 2016, 06:24 AM
#20
Re: how to display two column value in combobox DisplayMember
okay, you have wonderful google skills
Maybe consider the fact that we all volunteer our time here and there are times that we consider it a waste of that time to reproduce something that we know is already out there and can be found in about 20 seconds.
I agree, sometimes me too just need point in right direction.. But I think this person posted question was pleading for more detail as he was not understand....
Last edited by schoemr; May 9th, 2016 at 06:34 AM.
-
May 9th, 2016, 06:56 AM
#21
Re: how to display two column value in combobox DisplayMember
Originally Posted by schoemr
okay, you have wonderful google skills
I agree, sometimes me too just need point in right direction.. But I think this person posted question was pleading for more detail as he was not understand....
If it was something that I'd done before myself then I may have done more but it's not. I was not inclined to spend the time to work out how to do it myself first when there was so little evidence of effort on their own behalf. You may think that's harsh. That's your prerogative. I'm not paid to do this though so, if I choose to not help someone for some reason, that's my prerogative.
-
Aug 2nd, 2016, 01:13 PM
#22
New Member
Re: how to display two column value in combobox DisplayMember
Originally Posted by jmcilhinney
If it was something that I'd done before myself then I may have done more but it's not. I was not inclined to spend the time to work out how to do it myself first when there was so little evidence of effort on their own behalf. You may think that's harsh. That's your prerogative. I'm not paid to do this though so, if I choose to not help someone for some reason, that's my prerogative.
Checking the example above with sql statement, I'm using:
Dim _sqlQuery As String = "SELECT fd_user_first_name + ' ' + fd_user_last_name AS full_name, fd_user_initials FROM " & TB_USERS
then I call cboProjectManager.DisplayMember="full_name"
and I get an error: Object reference not set to an instance of an object.
I'm thinking I should declare full_name somehow. Any help is appreciated.
-
Aug 2nd, 2016, 02:00 PM
#23
New Member
Re: how to display two column value in combobox DisplayMember
never mind. I forgot to initialize some of the sql elements.
-
Aug 2nd, 2016, 02:07 PM
#24
New Member
Re: how to display two column value in combobox DisplayMember
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|