0

I'm using c# 2010 , I want to display combo-box list on search like this : enter image description here

In my case, I have a table "Client", is there any way to set Display-Member which contains three fields of "Client" : FirstName, LastName, City as shown in the image above?

dovid
  • 6,354
  • 3
  • 33
  • 73
aEk BKF
  • 131
  • 1
  • 2
  • 15
  • Winforms? ASP .net? Please tag the question accordingly. Your question is valid, but I don't know how to answer it without knowing more context. EDIT: `.net` still doesn't clarify much I'm afraid. Tag again. –  Jun 23 '14 at 10:35
  • Thanks for remark, I've updated it – aEk BKF Jun 23 '14 at 10:37
  • I'm going to assume this is winforms, as ASP .net would term it 'DropDownList' instead, but it could still easily be misinterpreted. –  Jun 23 '14 at 10:38
  • see http://stackoverflow.com/q/1091414/1271037, http://support.microsoft.com/kb/982498, http://www.codeproject.com/Articles/19781/A-data-bound-multi-column-combobox, http://www.codeproject.com/Articles/3206/Multi-Column-ComboBox, http://www.codeproject.com/Articles/3513/Multi-Column-ComboBox – dovid Jun 23 '14 at 12:07
  • Maybe you can to add additional column in your dtatsource, that will combine all data you need, and set it as DisplayMember? – Lev Z Jun 23 '14 at 12:58
  • @Lev I've already done what, but the problem is the combobox searches only from the beginning, e.g : if you have an item like this : Text1 | Text2 | Word, and you type 'word', no result ! – aEk BKF Jun 23 '14 at 13:07
  • You talking about autoComplete? – Lev Z Jun 23 '14 at 13:18
  • No, my problem is not how to set display member which contains three fields, but how to search any word in item. e.g : if we have : item1=" text1 text2 word word"; item2=" aaa bbb ccc "; so when you type cc, you won't get any result ! – aEk BKF Jun 23 '14 at 13:24
  • This is tagged with sql. Can you include the sql query that you are using? – Jenn Jun 23 '14 at 15:14

1 Answers1

0

So no one helped me, thanks all for comments, in fact I found a solution : I set a panel located under Combobox, contains a Datagridview assigned to Client DataSource, I play with hide/show and Combobox_textChanged :)

aEk BKF
  • 131
  • 1
  • 2
  • 15