all groups > dotnet windows forms > january 2006 >
You're in the

dotnet windows forms

group:

Set Text in DropDown


Set Text in DropDown mailptudo NO[at]SPAM gmail.com
1/31/2006 4:04:09 AM
dotnet windows forms: Hello,

I have a DropDown that is bound with a array containing 3 strings:
First, Last, All. These options indicate how many objects the user
wants to analyze. So, the user shoud choose one of these options, or
type a number.

These information is then saved, to be reloaded later.

My problem is to load the configuration when a number was typed. I've
the DropDown bound and I want to write the number in the text field.
I'm doing the following:

CB_Counter.Text= counter.MaxValue.ToString();

but this doesn't work, because the selectedItem is not -1.... I've
tryed to do CB_Counter.SelectedIndex = -1;

but nothing happens, and the SelectedIndex remains 0.

Hope you can help me, thanks in advance!

ACC
Re: Set Text in DropDown Tim Wilson
1/31/2006 7:23:49 AM
[quoted text, click to view]

This is a bug. You can set the SelectedIndex property to -1 twice as a
workaround.
http://support.microsoft.com/default.aspx?scid=kb;en-us;327244

--
Tim Wilson
..NET Compact Framework MVP

[quoted text, click to view]

AddThis Social Bookmark Button