|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Bound combo box problemI have a combo box on a form with DropDownStyle = DropDownList I have bound it as follows: cmboOp.DataSource = opTable cmboOp.DisplayMember = "OperatorName" cmboOp.ValueMember = "OperatorID The binding works fine. I put a test button on the form that does the following: cmboOp.SelectedIndex = -1 The first time I click the button, the combo box displays the first item in the list. The second time it is blank. I had expected it to be blank on the first time. So what is going on or what have I done wrong? TIA, John JL,
I thought that this has been in past often in the newsgroup. Can you try to set it twice to "-1", there was a bug which had this behaviour, however I don't know if it is fixed with sp1 and/or that it is exactly your problem. I hope this helps, Cor
Show quote
Hide quote
"J L" <j***@marymonte.com> schrieb: BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1> I have a combo box on a form with DropDownStyle = DropDownList > > I have bound it as follows: > > cmboOp.DataSource = opTable > cmboOp.DisplayMember = "OperatorName" > cmboOp.ValueMember = "OperatorID > > The binding works fine. I put a test button on the form that does the > following: > > cmboOp.SelectedIndex = -1 > > The first time I click the button, the combo box displays the first > item in the list. The second time it is blank. <URL:http://support.microsoft.com/?scid=kb;EN-US;327244> Try setting 'SelectedIndex' twice. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks Cor and Herfried,
I thought I had tried setting it twice but I guess not because that works fine. Also, I did try a google search before trougling the group with an old question but could not find the link you supplied. So once again, thank you to the Gurus!! John On Mon, 11 Apr 2005 11:36:39 +0200, "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote: Show quoteHide quote >"J L" <j***@marymonte.com> schrieb: >> I have a combo box on a form with DropDownStyle = DropDownList >> >> I have bound it as follows: >> >> cmboOp.DataSource = opTable >> cmboOp.DisplayMember = "OperatorName" >> cmboOp.ValueMember = "OperatorID >> >> The binding works fine. I put a test button on the form that does the >> following: >> >> cmboOp.SelectedIndex = -1 >> >> The first time I click the button, the combo box displays the first >> item in the list. The second time it is blank. > >BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1 ><URL:http://support.microsoft.com/?scid=kb;EN-US;327244> > >Try setting 'SelectedIndex' twice.
cint and int32.parse
Hide unwanted properties. Can't destroy Excel Process; tried Just about everything! NullReferenceException when setting to array list My application exits after handling an ApplicationException Connection pool problems Error after removing row and then adding new row to datatable Public Variables in Module1 How to copy files from desktop to web server Visual Basic.net and SQL Server |
|||||||||||||||||||||||