Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to save and display a sorted ListBox Control??

How to save and display a sorted ListBox Control??

Scheduled Pinned Locked Moved ASP.NET
databasequestionhelptutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Imran Adam
    wrote on last edited by
    #1

    Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM

    M L I 3 Replies Last reply
    0
    • I Imran Adam

      Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      Posted in multiple forumns :omg: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2678901

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • I Imran Adam

        Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM

        L Offline
        L Offline
        leckey 0
        wrote on last edited by
        #3

        Cross-poster.

        Blog link to be reinstated at a later date.

        1 Reply Last reply
        0
        • I Imran Adam

          Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM

          I Offline
          I Offline
          Imran Adam
          wrote on last edited by
          #4

          Sorry for cross posting. Does this mean i get no help ?? :(

          ------------------- Redcastle CRM

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups