How to make dropdown display updates?

  • Thread starter Thread starter clara
  • Start date Start date
C

clara

Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

Clara
 
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

You;ll need to post the offending code if anyone is going to be able
to help you. It sounds like you are doing exactly what you need to,
although I am not sure what you mean by refresh. All you should have
to do is clear the combobox's current list and re-add them all.
 
Hi all,

After insert an new record into database, I want to let it dsiplay the new
added field , I repopulate the items , and call refrest, but the new item is
still missing.

Clara

Try calling the update method. This has driven me mad in the past; you
read the definition of the refresh method and it seems to be exactly
what you want but does not seem to work in practice. Let us now if it
works.
 
Hi there,

I tried to use Refresh or Update, but they all failed. This is my code:

Public Sub FillActID(ByRef ComboBoxEventID As ComboBox)
Dim sqlDataReader As SqlClient.SqlDataReader
Dim sqlString As String = "select Event_id from Act_ID"

sqlDataReader = CreateReader(sqlString)

While (sqlDataReader.Read())
ComboBoxEventID.Items.Add(CInt(sqlDataReader.Item("event_id")))
End While
ComboBoxEventID.Refresh()
ComboBoxEventID.Update()


sqlDataReader.Close()
End Sub

Clara
thank you so much for your help
 
Back
Top