PC Review


Reply
Thread Tools Rate Thread

Cant set SelectedValue on combobox

 
 
Patricia Kline
Guest
Posts: n/a
 
      11th May 2004
I am setting the datasource of a combobox to a arraylist that has two
members (value and display). When I want to get the value of the combobox,
there are no problems. However, when I try to set the selectedvalue to a
value that I know for a fact is in there, using this code:

cboAuthor.SelectedValue = intOldAuthor

nothing happens. If I do a for loop, setting the selectedindex and a if
statement, with the following code:

For x = 0 To cboAuthor.Items.Count - 1
cboAuthor.Items.Item(x) = x
If cboAuthor.SelectedValue = intOldAuthor Then
Exit For
End If
Next

I can get the desired value, but the end user will be able to see it going
thru the list. Any suggestions on how I can set the SelectedValue as if I
were just connected to a dataset???



 
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
Set a combobox selectedvalue problem sfauchille@gmail.com Microsoft VB .NET 0 9th Oct 2008 09:50 AM
ComboBox SelectedValue is null T Microsoft Dot NET Framework Forms 3 22nd May 2007 05:25 AM
ComboBox SelectedValue is null T Microsoft Dot NET Framework Forms 0 20th May 2007 06:02 PM
pb with .selectedvalue of a combobox Sam Microsoft VB .NET 7 19th Apr 2005 05:45 PM
Set ComboBox SelectedValue Rajesh Patel Microsoft VB .NET 5 31st Oct 2003 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 AM.