List Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dayanandk
    New Member
    • Feb 2008
    • 1

    #1

    List Box

    How to copy all the values from one listbox to another listbox at atime
    please reply to me as early as possible
  • gkn
    New Member
    • Feb 2008
    • 4

    #2
    Originally posted by dayanandk
    How to copy all the values from one listbox to another listbox at atime
    please reply to me as early as possible
    Do you want to copy values at the same time to both list boxes or want to copy from one list box to another when you click button?

    Comment

    • gauthambr83
      New Member
      • Feb 2008
      • 8

      #3
      ListBox

      Originally posted by dayanandk
      How to copy all the values from one listbox to another listbox at atime
      please reply to me as early as possible

      protected void btnSelectAll_Cl ick(object sender, EventArgs e)
      {

      foreach (ListItem list in ListBox1.Items)
      {
      ListItem lst = new ListItem();
      lst.Value = list.Value;
      lst.Text = list.Text;

      ListBox2.Items. Add(lst);


      }


      }


      Correct me if am wrong.
      Last edited by gauthambr83; Feb 9 '08, 07:22 AM. Reason: Coding

      Comment

      Working...