DataBound ComboBox

D

Dave

I've got a data bound comboBox on a tag page, by default I manually set the
selectedIndex to -1. When the user changes tabs, and then changes tabs back
the selectedIndex goes to 0. (I originally had problems setting the
selectedIndex to -1, but found it was a framework 1.0 bug with a work
around. I've since upgraded to framework 1.1, and still have this tabPage
change issue.) I've tried saving the selectedIndex in the tag property and
when the page changes checking for comboBoxes where the selectedIndex does
not equal the tag, and updating the selectedIndex to match the tag (-1), but
the selectedIndex stays at 0. Any ideas?

Dave
 
V

vijai thoppae

dave,

I had the same issue earlier, you may need to set the selectedIndex = -1,
Twice, rather than once to over come this issue.

Vijai
 
D

Dave

I've tried that, didn't make a difference.


| dave,
|
| I had the same issue earlier, you may need to set the selectedIndex = -1,
| Twice, rather than once to over come this issue.
|
| Vijai
| | > I've got a data bound comboBox on a tag page, by default I manually set
| the
| > selectedIndex to -1. When the user changes tabs, and then changes tabs
| back
| > the selectedIndex goes to 0. (I originally had problems setting the
| > selectedIndex to -1, but found it was a framework 1.0 bug with a work
| > around. I've since upgraded to framework 1.1, and still have this
tabPage
| > change issue.) I've tried saving the selectedIndex in the tag property
| and
| > when the page changes checking for comboBoxes where the selectedIndex
does
| > not equal the tag, and updating the selectedIndex to match the tag (-1),
| but
| > the selectedIndex stays at 0. Any ideas?
| >
| > Dave
| >
| >
|
|
 
D

Dave

I can change the selectedIndex to anything but -1.

| dave,
|
| I had the same issue earlier, you may need to set the selectedIndex = -1,
| Twice, rather than once to over come this issue.
|
| Vijai
| | > I've got a data bound comboBox on a tag page, by default I manually set
| the
| > selectedIndex to -1. When the user changes tabs, and then changes tabs
| back
| > the selectedIndex goes to 0. (I originally had problems setting the
| > selectedIndex to -1, but found it was a framework 1.0 bug with a work
| > around. I've since upgraded to framework 1.1, and still have this
tabPage
| > change issue.) I've tried saving the selectedIndex in the tag property
| and
| > when the page changes checking for comboBoxes where the selectedIndex
does
| > not equal the tag, and updating the selectedIndex to match the tag (-1),
| but
| > the selectedIndex stays at 0. Any ideas?
| >
| > Dave
| >
| >
|
|
 
V

vijai thoppae

Dave,

Let me tell you what i did. In my Form, i've a ListView containing list of
Items on the left, on the right having a panel which will host the
corresponding UserControls based upon the selected Items in the left. In one
of the UserControl i've to set the combobox's SelectedIndex = -1. From my
understating the way it works is, atleast once the user has to visit the
Page, & the second time it shows the SelectedIndex as -1. So what i did is
whenever the user selects the ListView, make a dummy call to Activate the
screen set the SelectedIndex twice to -1, then DeActivate it & again call
Activate & set the SelectedIndex twice to -1 which made it to work. I guess
in u'r case whenever that corresponding TabPage is selected, set the
SelectedIndex = -1 twice, then deactivate it & again Select the TabPage
Internally in the TabPage SelectedIndex event.

Hope it helps you.

Thanks,
Vijai

In u'r scenario its a TabPage change, i
 

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