RE: ListBox.SelectionMode = SelectionMode.None





"John A Grandy" wrote:

Apparently with ListBox.SelectionMode = SelectionMode.None it is not
possible to data-bind the control programmatically ?


When setting SelectionMode.None, you effectively remove the Selected#
properties so you can't use those properties anymore, including DataBinding
against them. You can still simulate selected items by using a BindingSource
and setting the BindingSource.Position property though, so if you allow
selection for only a few people you can update this property in a
ListBox.SelectedIndexChanged event.

--
Happy Coding!
Morten Wennevik [C# MVP]


.


Loading