473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

PLEASE? Reorder of listitems only works first time

K B
I'm using ASP.NET 2.0 and am still struggling. I use the following code
to reorder items in a listbox. When complete, a Save button saves each
item to a database. Works fine for the first click (runat=Server) but on
subsequent use the item just seems to go anywhere...usually to the top
of the list.

PLEASE, how can I accomplish this using a listbox control and code (not
javascript)?

Dim mSelectedIndex, mOtherIndex As Integer
'do nothing if the first item is selected
If lstQuestions.SelectedIndex <> 0 Then
mSelectedIndex = lstQuestions.SelectedIndex
mOtherIndex = mSelectedIndex - 1
lstQuestions.Items.Insert(mSelectedIndex + 1,
lstQuestions.Items(mOtherIndex))
lstQuestions.Items.RemoveAt(mOtherIndex)
End If

TIA.

*** Sent via Developersdex http://www.developersdex.com ***
May 23 '06 #1
0 999

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dmitri Shvetsov | last post by:
Hi, I'm working with the MSSQL 2000 and C#. When I load my data from the database table in a DataSet I use the query to order all records by some column. Then I can work with these records,...
1
by: Jeff | last post by:
Hi - I'm creating a web control library (using VB.NET), and I'm trying to add a modified asp:dropdownlist control to it. How do I add asp:ListItems to the dropdownlist (within the web control...
1
by: Mat | last post by:
Reordering Column changes column Indexes???? i use column.index to access(or add ) data in listview. i want to allow user to reorder columns as they need. So i am afraid to get wrong data when user...
0
by: uv507 | last post by:
Hello, I have found a way to easily reorder rows of my listview. But it only works in small icons mode. When I do my reordering (drag and drop in my own list) in large icons mode, the item that...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
by: Kyle K. | last post by:
(Note: Windows XP Pro SP2 + Visual Studio .NET 2005 + SQL Server 2000) I have a GridView that is populated with data. That last 2 columns are button fields (image buttons) that have a CommandName...
0
by: daju | last post by:
hello My question is, after we allow the column reorder can we modify the order of columns through our code. What I need to do is reorder the listview columns so the first column with the...
0
by: Rita | last post by:
Hi Everyone, I try to migrate a VB6 app to VB 2005. I have a problem with the migration of the Ax.Listview. I want to use the VB 2005 Listview insteed. I load a text file in the listview LV....
4
by: rdraider | last post by:
Use the Northwind database Products table as an example. Purchasing dept gets a report showing when inventory items on hand qty are below the reorder level. easy enough: Select ProductID,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.