Refresh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mwcapps
    New Member
    • Mar 2009
    • 16

    #1

    Refresh

    I'm using a button click to move users from one list box to another. Is there a way to 'refresh' the listboxes at the end of the click event? Thanks
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    Can you elaborate more? i didn't get your question ...To auto refresh a page you can
    Code:
    Response.AppendHeader("Refresh", Convert.ToString(5));

    Comment

    • mwcapps
      New Member
      • Mar 2009
      • 16

      #3
      I've got a VB.net form that has two listboxes that are populated from two different hashtables. lbAvail is a listbox with all users. lbAssign is a listbox with users for a particular dept. When you pick a user in lbAvail and click 'Assign' (cmdAssign command button), that person is then assigned to the dept. Unfortunately, lbAssign isn't updated after the click event. I have to close the app. then re-run it to see the updated lbAssign.

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        Originally posted by mwcapps
        I'm using a button click to move users from one list box to another. Is there a way to 'refresh' the listboxes at the end of the click event? Thanks
        Have you tried the .Refresh() method?

        Code:
                    ListBox bob = new ListBox();
                    bob.Refresh();

        Comment

        • mwcapps
          New Member
          • Mar 2009
          • 16

          #5
          I've tried the .Refresh() and nothing happens. Where should I put the 'Listbox bob = new ListBox()' line?

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            You don't actually have to make a ListBox named Bob. I just put that in there for some context of how I was using the .Refresh() method on a ListBox object.

            Let me ask you a couple questions here.
            You are assigning and re-assigning values within your database.
            After you do that, are you adding the new items to your ListBox.Items collection?
            Are the ListBoxes databound to the database or are they just controls on a form?

            Maybe including the code that you are using would help.

            Comment

            Working...