MS Please help.. Urgent problem with ListBox or TabControl

G

Guest

I have a problem with a ListBox control that is on a TabControl, it seems to
be forgetting which items are selected in the list when I tab off the current
tab, here's my winform code... I even added a click event handler that resets
the selected items based on whats in the collection it is data bound to...
I'm baffled, pounding my head against the wall, it's not working... Please
help...

I tried posting the code but it was too long, email me and I will send it to
you if you'd like to help... TIA
 
C

Chris Calzaretta

Check to make sure on tab click your not clearing out values.
Check to make sure your not calling your load function to load the listbox
after the 1 time.

email me
(e-mail address removed)
 
H

Herfried K. Wagner [MVP]

Alien2_51 said:
I have a problem with a ListBox control that is on a TabControl, it seems
to
be forgetting which items are selected in the list when I tab off the
current
tab, here's my winform code... I even added a click event handler that
resets
the selected items based on whats in the collection it is data bound to...
I'm baffled, pounding my head against the wall, it's not working...

That's a problem I have heard about several times.

<URL:http://groups.google.de/[email protected]>

Maybe installing SP1 for .NET 1.1 will help (untested!).

This problem seems to be related to these problems/bugs:

PRB: Unexpected Events Are Raised When You Switch Between Tab Pages with a
ComboBox or a ListBox Control
<URL:http://support.microsoft.com/?scid=kb;EN-US;820633>

BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1
<URL:http://support.microsoft.com/?scid=kb;EN-US;327244>

BUG: CheckedListBox Control Loses Check Marks When the Visible Property Is
Changed to FALSE and Then Back to TRUE
<URL:http://support.microsoft.com/?scid=kb;EN-US;327896>
 
G

Guest

I added an event handler for the BindigContextChanged event, it is firing
when I click back to the tab page with the ListBox on it, this makes me think
I'm running into the problem described in KB:820633, I'm running the 1.1
framework version 1.1.4322 (sp1), I looked at your post in the google thread
you posted, is that pretty much what I'm going to have to do is remove the
ListBox from the TabControl...?


Thank you for your help...!~!~!

-Dan
 
G

Guest

Thanks for your reply, I appreciate your help… I emailed you my code, I'm
using CSLA objects as the data source for my winform applications… I looked
at Herfrieds post, it looks like the problem described in this KB article, I
added the BindingContextChanged event to my form like the KB article says to
do and sure enough that event is bieng raised… The article doesn'tseem to
indicate there is a problem, it states that the behaviour is by design...
http://support.microsoft.com/?scid=kb;EN-US;820633

What to do...? Don't use the TabControl...?


TIA....Dan
 
G

Guest

I'm not sure what this does, but it fixed my problem, Thanks!!!

tabPage.BindingContext = myForm.BindingContext
 

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

Top