Solved

How to use value member with a databound combobox

Posted on 2007-11-14
3
829 Views
Last Modified: 2013-12-17
I have a combobox that is bound to a table. The display member is the column that has the persons name. The value member is linked to the column that has the persons social security number. I have two questions:

What is the best event to use when dealing with comboboxes. I just want the basic one where when the user selects an item, it will run code from the event.

Lets say I have a variable 'x'. How do I set x to the persons social security number on the event when someone selects a name.
0
Comment
Question by:tiehaze
  • 2
3 Comments
 
LVL 23

Assisted Solution

by:Ashish Patel
Ashish Patel earned 500 total points
ID: 20287046
onChange Event.

in javascript
var x = document.forms[0].ComboBoxName.value;
0
 

Author Comment

by:tiehaze
ID: 20287065
I am using visual studio... there is no onChange event for comboboxes.

I am also using c#
0
 
LVL 23

Accepted Solution

by:
Ashish Patel earned 500 total points
ID: 20287132
You need event for javascript or C# code behind?
If javascript event is required then go to html souce code and in the CheckBox list tag write onChange manually, as this wont appear in the event list. like below

<asp:CheckBoxList ID="CheckBoxList1" runat="server" onChange="CallFunction()">
        </asp:CheckBoxList>

And if you need C# event then just double click on the CheckBox List and SelectedIndexChange event will turn up and you will have to use this.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now