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 by Tim

Tim
Tue Jan 31 06:23:49 CST 2006

> I've tryed to do CB_Counter.SelectedIndex = -1;
> but nothing happens, and the SelectedIndex remains 0.

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

<mailptudo@gmail.com> wrote in message
news:1138709049.215544.34930@g44g2000cwa.googlegroups.com...
> 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
>