Solved

How to use value member with a databound combobox

Posted on 2007-11-14
3
834 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 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