Solved

c# validation on combo boxes

Posted on 2014-01-12
2
230 Views
Last Modified: 2014-03-18
Hi,

I have 4 combo boxes

the default value is "-- Please Select --", i want a validation that says

1) Only one can be set NOT to  "-- Please Select --" the rest 3 have TO be set to  "-- Please Select --"

Please help

Thanks

R8vI
0
Comment
Question by:R8VI
2 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
I think you should look for some control alternative like this:
a combo box with a "tree-view" like display
http://www.brad-smith.info/blog/archives/104
will be easier for the user, I would say?
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
Comment Utility
Dim count As Integer

            count = CInt(ComboBox1.Text = "-- Please Select --")
            count += CInt(ComboBox2.Text = "-- Please Select --")
            count += CInt(ComboBox3.Text = "-- Please Select --")
            count += CInt(ComboBox4.Text = "-- Please Select --")

            If count <> -3 Then
                  MessageBox.Show("Bad")
            End If
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

11 Experts available now in Live!

Get 1:1 Help Now