Home All Groups Group Topic Archive Search About

listbox datatable selected item

Author
28 Dec 2006 10:38 PM
cptkirkh
I havea listbox bound to a datatable.  When the form loads it thinks
the first item is selected.  Is there anyway to tell the listbox when
it loads not to select the first time automatically?

Author
29 Dec 2006 2:02 AM
Stephany Young
In the form's Load event handler:

  Fill the DataTable

  Set the SelectedIndex property of the ListBox to -1

  Add the desired event handlers to the corresponding events of the ListBox

In this case Do NOT 'wire' up the event handlers for the ListBox at design
time.


Show quoteHide quote
"cptkirkh" <kh***@scic.com> wrote in message
news:1167345494.375587.39650@i12g2000cwa.googlegroups.com...
>I havea listbox bound to a datatable.  When the form loads it thinks
> the first item is selected.  Is there anyway to tell the listbox when
> it loads not to select the first time automatically?
>

Bookmark and Share

Post Thread options