2 Replies - 334 Views - Last Post: 03 February 2012 - 04:53 PM Rate Topic: -----

Topic Sponsor:

#1 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

how to: refresh combobox data

Posted 03 February 2012 - 04:34 PM

I have combobox binded to binding source (NastavniciBindingSource). I wan't to refresh combobox when I add new data.
        Dim str As String = InputBox("Enter name:") 
        Me.NastavniciTableAdapter.Insert(str, "", "", "", "")
        Me.Validate()
        Me.NastavniciBindingSource.EndEdit()
        Me.NastavniciTableAdapter.Update(Me.StudentDSET.Tables("Nastavnici"))

' here I need the code to refresh combobox




Is This A Good Question/Topic? 0
  • +

Replies To: how to: refresh combobox data

#2 DimitriV  Icon User is offline

  • It's been so long, without this feeling
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,533
  • Joined: 24-July 11

Re: how to: refresh combobox data

Posted 03 February 2012 - 04:43 PM

Are you getting data at the load of the application? As in, when the form loads, is data being added? If so, you could call this method, preceded by
ComboBox1.Items.Clear()

If you have any, can you post the code to populate the ComboBox and well work from there.
Was This Post Helpful? 1
  • +
  • -

#3 sela007  Icon User is offline

  • D.I.C Addict

Reputation: 67
  • View blog
  • Posts: 522
  • Joined: 21-December 11

Re: how to: refresh combobox data

Posted 03 February 2012 - 04:53 PM

this is code in the form load event generated by vs.
        'TODO: This line of code loads data into the 'StudentDSET.Nastavnici' table. You can move, or remove it, as needed.
        Me.NastavniciTableAdapter.Fill(Me.StudentDSET.Nastavnici)



this works thanks!

This post has been edited by sela007: 04 February 2012 - 07:23 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1