Link to home
Start Free TrialLog in
Avatar of Dalexan
DalexanFlag for Afghanistan

asked on

VB.NET checked List Box validation

I am writing a simple data entry form and want to use the checked list box. Each box may have more than 2 items in the collection but only one should be selectable at a time. This value should also update the bound SQL server field with the name of the item selected from the collection. I need help with the syntax to make this happen!

what I have so far:

Private Sub clbDeadorAlive_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles clbDeadorAlive.ItemCheck

End Sub

Dead or Alive being the items in the collection, There are also CLB's with 4 or more items in the collection.

Avatar of mmarinov
mmarinov

Why don't you use RadioButtonList
if you choose that the only thing that you will have to do is to check if the an item of this list is selected
this could be done by two ways
use RequireFieldValidator and set it's property ControlToValidate to this list
you can write your own validator in your page_load

B..G
Avatar of Dalexan

ASKER

Can you type out the syntax for the RadioButtonList control.
ASKER CERTIFIED SOLUTION
Avatar of mmarinov
mmarinov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial