?
Solved

.NET combobox question

Posted on 2012-08-17
4
Medium Priority
?
412 Views
Last Modified: 2012-08-19
I was wondering with a combobox if you have a value and a display like in HTML

<select>
<option value="databaseFirstNameField">First Name</option>
<option value="databaseLastNameField">Last Name</option>
<option value="databaseTelephoneNameField">Telephone</option>
<option value="databaseEmailNameField">Email</option>
</select>

Open in new window


if not how would I do this in .NET its a small search engine for customers so first you select to search by Name, telephone, email etc etc and then enter the keyword

then my query would be something like:

SELECT * FROM customers WHERE COMBOBOX_VALUE = KEYWORD.TEXT
0
Comment
Question by:prowebinteractiveinc
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38307289
Yes, the ComboBox has the SelectedText and the SelectedValue properties which will give you the respective data.
0
 

Author Comment

by:prowebinteractiveinc
ID: 38307305
ok but how do I define that in the combobox ?
0
 
LVL 9

Accepted Solution

by:
sarabhai earned 2000 total points
ID: 38307555
<option value="L2B">Background - Column 2</option>
<option value="TBD">Background - Column 3</option>
this is in the html

and SelectedText /SelectedValue  are using in c# code the code behind page code to check the selected item value /text.

comboboxName.selectedValue
comboboxName.selectedText have the value for selected combobox option.
0
 

Author Comment

by:prowebinteractiveinc
ID: 38307901
I dont think im being clear on what I need

How do I populate the combobox with Values and displays ?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question