PC Review


Reply
Thread Tools Rate Thread

ComboBox remains selected after databind

 
 
Dirk Meusel
Guest
Posts: n/a
 
      31st Aug 2004
I use several Comboboxes on my Windows Forms that are programmed with
VB.NET and VS 2002. For reasons of convenience, the Comboboxes are
filled by databinding them to a dataset. Everything works fine, except
that all Comboboxes are by default marked (or better: the text shown
is selected). Only after clicking once into each Combobox, they appear
in the usual way unselected or unmarked. Its kind of nothing much
important, but when i open a winform with 10 Comboboxes in it, it
looks quite confusing to all of them marked.

So, how can I get the Comboboxes appearing unmarked after they are
bound to a dataset???

I already tried Refreshing the form after databinding as well as
setting the focus to each of the Comboboxes. Neither of these worked.
Any suggestions???

Thanks all!
Dirk Meusel
 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      31st Aug 2004
Dirk,

Probably is it solved when you set the selectedindex two times to -1

It is a known bug.

Cor


 
Reply With Quote
 
Dirk Meusel
Guest
Posts: n/a
 
      1st Sep 2004
Thanks Cor, for your reply, but it does not work either. I tried it
the following way in every combination within the FormLoad Event as
well as after the Oleadapter fills the dataset (which is in a separat
function).

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1

Any more suggestions?

Dirk

"Cor Ligthert" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Dirk,
>
> Probably is it solved when you set the selectedindex two times to -1
>
> It is a known bug.
>
> Cor

 
Reply With Quote
 
Nikolay Petrov
Guest
Posts: n/a
 
      1st Sep 2004
Do it after all databinding

"Dirk Meusel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Cor, for your reply, but it does not work either. I tried it
> the following way in every combination within the FormLoad Event as
> well as after the Oleadapter fills the dataset (which is in a separat
> function).
>
> Me.cmb1.SelectedIndex = -1
> Me.cmb1.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
>
> Any more suggestions?
>
> Dirk
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message

news:<(E-Mail Removed)>...
> > Dirk,
> >
> > Probably is it solved when you set the selectedindex two times to -1
> >
> > It is a known bug.
> >
> > Cor



 
Reply With Quote
 
Piedro
Guest
Posts: n/a
 
      1st Sep 2004
Maybe this helps

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

hth
gr Peter



(E-Mail Removed) (Dirk Meusel) wrote in message news:<(E-Mail Removed)>...
> Thanks Cor, for your reply, but it does not work either. I tried it
> the following way in every combination within the FormLoad Event as
> well as after the Oleadapter fills the dataset (which is in a separat
> function).
>
> Me.cmb1.SelectedIndex = -1
> Me.cmb1.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
>
> Any more suggestions?
>
> Dirk
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > Dirk,
> >
> > Probably is it solved when you set the selectedindex two times to -1
> >
> > It is a known bug.
> >
> > Cor

 
Reply With Quote
 
Dirk Meusel
Guest
Posts: n/a
 
      1st Sep 2004
Hi Peter,

It worked not out as well, even the combination of both does not have
any effect, I tried:

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

as well as:

Me.cmb1.SelectedIndex = -1
Me.cmb1.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
Me.cmb2.SelectedIndex = -1
me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

thanks, Dirk

*****************************************************+
From: Piedro
Date Posted: 9/1/2004 5:25:00 AM



Maybe this helps

me.cmb1.SelectionLength = 0
me.cmb2.Selectionlength = 0

hth
gr Peter



(E-Mail Removed) (Dirk Meusel) wrote in message news:<(E-Mail Removed)>...
> Thanks Cor, for your reply, but it does not work either. I tried it
> the following way in every combination within the FormLoad Event as
> well as after the Oleadapter fills the dataset (which is in a separat
> function).
>
> Me.cmb1.SelectedIndex = -1
> Me.cmb1.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
> Me.cmb2.SelectedIndex = -1
>
> Any more suggestions?
>
> Dirk
>
> "Cor Ligthert" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > Dirk,
> >
> > Probably is it solved when you set the selectedindex two times to -1
> >
> > It is a known bug.
> >
> > Cor

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Databind enum to a ComboBox =?Utf-8?B?Um93bGFuZCBTaGF3?= Microsoft Dot NET Framework Forms 2 15th Feb 2008 08:09 AM
How to DataBind a UserControl with ComboBox? Steve K. Microsoft C# .NET 13 21st Jan 2008 11:10 AM
Combobox text remains selected Michael Jackson Microsoft Dot NET Framework Forms 5 12th Nov 2005 08:35 AM
Combobox - Name / Value without DataBind Brian K. Williams Microsoft Dot NET Framework Forms 3 2nd Apr 2004 06:57 PM
Dual ComboBox Databind Brian K. Williams Microsoft Dot NET Framework Forms 0 29th Mar 2004 07:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:48 AM.