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. Asp.net ListBox Items(move to top,Move to bottom)

Asp.net ListBox Items(move to top,Move to bottom)

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
3 Posts 3 Posters 1 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.
  • P Offline
    P Offline
    Pawan Kiran
    wrote on last edited by
    #1

    I have a listbox and MovetoTopbutton,MovetoBottombutton when i select an item in the listbox and if i click on MovetoTopbutton then the selected item should be placed in top of the listbox vise versa for MovetoBottombutton how to do this one.................

    C P 2 Replies Last reply
    0
    • P Pawan Kiran

      I have a listbox and MovetoTopbutton,MovetoBottombutton when i select an item in the listbox and if i click on MovetoTopbutton then the selected item should be placed in top of the listbox vise versa for MovetoBottombutton how to do this one.................

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Someone else asked this a couple of posts down ( or you asked twice with two different accounts) . It's done with javascript, which means it's not really an ASP.NET question. Google for samples

      Christian Graus Driven to the arms of OSX by Vista. "I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )

      1 Reply Last reply
      0
      • P Pawan Kiran

        I have a listbox and MovetoTopbutton,MovetoBottombutton when i select an item in the listbox and if i click on MovetoTopbutton then the selected item should be placed in top of the listbox vise versa for MovetoBottombutton how to do this one.................

        P Offline
        P Offline
        Perry Holman
        wrote on last edited by
        #3

        Here is a sample which moves the selected item up. You can revise to meet your need. protected void LinkButtonMoveUpProducts_Click(object sender, EventArgs e) { if (this.ListBoxProducts.SelectedIndex <= 0) { return; } int index = this.ListBoxProducts.SelectedIndex; ListItem li = this.ListBoxProducts.SelectedItem; this.ListBoxProducts.Items.Remove(li); this.ListBoxProducts.Items.Insert(index - 1, li); }

        Welcome to www.softwaretree.net! You can find many excellent audio/video converter tools there!

        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