Solved

c# validation on combo boxes

Posted on 2014-01-12
2
234 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]
ID: 39774693
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
ID: 39775052
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

911 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

18 Experts available now in Live!

Get 1:1 Help Now