asp:ListBox allow select none?

G

Guest

Hi guys

I've got a List of items for editing a Contact. Basically, it's a list of
groups - a contact can be a member of as many as possible, or a member of one.

Is there a way to make asp:ListBox allow none to be selected!?

Failing that, any free controls that will do it?

Cheers


Dan
 
M

Mr Newbie

You could make the first selection item "Select None" and in the changed
event

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

If ListBox1.SelectedIndex = 0 Then

ListBox1.SelectedIndex = -1

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top