A
Alex Stevens
Hi All,
I've come across something which I think is a bug in the windows forms
combobox and listboxes.
I have a simple form which retrieves a datatable, and then set the
datasource of a listbox to the datatable.
I then set the displaymember / valuemember to the appropriate fields of the
datatable.
Then I set the selectedindex to -1
On a form opened with it's MDIParent set to an MDI container (a form in my
case), the first entry in the list is selected when the form is opened
(SelectedIndex = 0).
If the same form is opened without an MDI parent, the listbox displays as
you would expect, without anything selected and it's (SelectedIndex = -1).
Anyone else found this, and got a workaround?
I've seen some posts regarding the SelectedIndex changing on a tab, but
nothing about an MDIparent issue?
Any help or an alternative method of filling a combo / lisbox with a display
/ valuemember would be appreaciated.
Thanks
Alex Stevens
I've come across something which I think is a bug in the windows forms
combobox and listboxes.
I have a simple form which retrieves a datatable, and then set the
datasource of a listbox to the datatable.
I then set the displaymember / valuemember to the appropriate fields of the
datatable.
Then I set the selectedindex to -1
On a form opened with it's MDIParent set to an MDI container (a form in my
case), the first entry in the list is selected when the form is opened
(SelectedIndex = 0).
If the same form is opened without an MDI parent, the listbox displays as
you would expect, without anything selected and it's (SelectedIndex = -1).
Anyone else found this, and got a workaround?
I've seen some posts regarding the SelectedIndex changing on a tab, but
nothing about an MDIparent issue?
Any help or an alternative method of filling a combo / lisbox with a display
/ valuemember would be appreaciated.
Thanks
Alex Stevens