combobox refresh problem


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 8 of 8

Thread: combobox refresh problem

  1. #1
    Join Date
    Mar 2009
    Posts
    2

    Question combobox refresh problem

    hello to all!
    m designing a windows application.i hv a frm which contains comboboxes and text boxes.cmbboxes are populated from data tables.i jst want them to b refreshed after adding record.bt they show the last selected value.combo boxes are nt refreshed using cmbName.refresh().i wan my form to cm to the original state as it wz first loaded.also hw to refresh datatime picker in vb.net.
    its urgent .cn anyone help me out

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Clear out the combos and reload them.

    Refresh datetime picker? Refresh from what? It is just a control that displays dates that can be selected....there is nothing to refresh.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    f u rly nd hlp try spln out ur wrds

    ...joe

  4. #4
    Join Date
    Mar 2008
    Posts
    130
    yeah just reload your codes..thats what i always do when i want to refresh something from my list..

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Quote Originally Posted by sumaira in a PM
    Thnx bt problem still exist, here is my code:
    after saving the record this pro is called
    Sub ClrAllTxtBox()
    cmbStore.DataSource = Nothing
    cmbSize.DataSource = Nothing
    cmbColor.DataSource = Nothing
    LblName.Text = ""
    TxtPartCode.Text = ""
    txtRate.Text = ""
    txtPartNo.Text = ""
    DtPk.Text = DateTime.Now()
    FillAllCombo()
    End Sub
    in FillCombo comboname along with tablename and displaymemeber and value member fields are passed:
    Sub FillAllCombo()
    fillcombo("MAST_STORE", cmbStore, "StoreID", "StoreName")
    fillcombo("MAST_SIZE", cmbSize, "SizeID", "SizeName")
    fillcombo("MAST_COLOR", cmbColor, "ColorID", "ColorName")
    End Sub
    bt after saving same values are shown which were selected b4.i hvn't found Reload or Refresh event for the form
    any suggestion wd b highly appreciated.
    Always reply in the thread you have created. Never in a PM. If you use a PM you are cutting yourself off from everyone on the entire site.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  6. #6
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    What is the code in FillCombo?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  7. #7
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Quote Originally Posted by sumaira View Post
    hello to all!
    m designing a windows application.i hv a frm which contains comboboxes and text boxes.cmbboxes are populated from data tables.i jst want them to b refreshed after adding record.bt they show the last selected value.combo boxes are nt refreshed using cmbName.refresh().i wan my form to cm to the original state as it wz first loaded.also hw to refresh datatime picker in vb.net.
    its urgent .cn anyone help me out

    Just so you understand, refresh just redraws the control. it doesn't refresh it's data/datasource.

    ...joe

  8. #8
    Join Date
    Mar 2009
    Posts
    2

    Post combobox refresh problem

    this is the code in fillcombo:
    Sub fillcombo(ByVal tblcombo, ByVal cmbName, ByVal col1, ByVal col2)


    With SqlCmd
    .Connection = SqlCon
    .CommandText = "select DISTINCT * from " & " " & tblcombo & " " & "order by " & " " & col1
    .CommandType = CommandType.Text
    sqlDataAdapter.SelectCommand = SqlCmd
    sqlDataAdapter.Fill(sqlDataSet, tblcombo)
    End With
    'populate dropdown list
    With cmbName
    .DataSource = sqlDataSet.Tables(tblcombo).DefaultView
    .DisplayMember = col2
    .ValueMember = col1
    End With
    ' SqlCmd.Dispose()
    End Sub

Similar Threads

  1. Memory problem with Borland C3.1
    By AZ1699 in forum C++
    Replies: 11
    Last Post: 11-16-2007, 12:23 PM
  2. login problem
    By dbrook007 in forum ASP.NET
    Replies: 0
    Last Post: 11-06-2006, 04:54 AM
  3. Reliability Problem
    By elise in forum Java
    Replies: 0
    Last Post: 10-30-2002, 04:40 AM
  4. GUI Refresh problem?
    By Lim Wing Hoe in forum Java
    Replies: 7
    Last Post: 11-17-2000, 02:12 PM
  5. JTextPane refresh problem under jdk 1.1.8 swing 1.1.1
    By François Bélair in forum Java
    Replies: 0
    Last Post: 08-26-2000, 02:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center