Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check ComboBox to see if it has been changed 1

Status
Not open for further replies.

eb24

Programmer
Dec 17, 2003
240
US
I am trying to do some validating, and when a certain TextBox is filled an accompanying value from a ComboBox should also be chosen. How can I check if a value from my ComboBox has been picked from its original state, which is nothing from the list of values?
Code:
if (this.txtCity != null) // *** TextBox is populated
{
  try
  {
    if (this.comboStates.SelectedItem = "") // *** ComboBox not chosen
    // display error message
    ...
 
if (this.txtCity != null) // *** TextBox is populated
{


this.txtCity.Text != null


and then

this.comboStates.SelectedIndex >= 0



it sounds like you're trying to do a search on a list via a textbox?

 
Thanks! That worked!

No, just doing some validation of business rules on Save event. Eventhough the database as these constraints in place, I wanted a UI level of validation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top