TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
eric 0
NA
5
0
Changing display order in a list
Dec 13 2003 5:44 PM
I'm sure this is an easy feat, but I'm having a dickens of a time figuring it out and I can't seem to find a decent example. I am using ComponentOne components to display data, but that really shoudn't matter. My application uses a number of tables that will populate pull-down combo boxes. I have three fields for the tables: iID - auto incrementing unique key cDesc - the Description or text that is displayed iOrder - the order to display them in. In my maintenance form, I have a dbgrid control that is linked the data table. Next to it are two button controls, one up arrow and one down arrow. For now, all three columns are displayed, but eventually I want only the description to be displayed. When a user clicks an up arrow, I want the current row in the dbgrid to move up one line. My logic is to number all the items automatically (iOrder) by two starting with 2 for the first one. When the user clicks up arrow, I subtract three from the iOrder of the current row, and then walk through the entire list, renumbering them by twos as I go along. Here's the rub ... how do I get the list to dynamically sort when I make that first change of subtracting three from the order. Should I be using an array instead, then updating the table in background? If there is an example application that does this that I could be pointed to, that would be great! Thank you for your time and assistance. Eric
Reply
Answers (
0
)
c# 2.0
file download