?
Solved

ASP.Net Dual Listbox updating

Posted on 2009-03-30
3
Medium Priority
?
453 Views
Last Modified: 2012-05-06
I have an ASP.Net page. Code is C#. The page displays 2 listboxes side-by-side. The first listbox displays data from a table in a database (MS Access). It lists all available products. The second list box displays all of the products that the user has selected. The second listbox's data will come from another table. Once a user selects a product and clicks the correct button, the product is moved to the seond listbox. I need to display the correct data in that second listbox based on the users login information. That second table will record product id and user id. The second listbox also needs the funtionality to move products up and down in rankings. Any help/samples with this is appreciated.
0
Comment
Question by:dodgerfan
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24027596
Is this your question?

      "I need to display the correct data in that second listbox based on the users login information"
0
 

Author Comment

by:dodgerfan
ID: 24028809
Sorry, I worded this horribly. My question is how I can move records up and down in the second list box. I have the functionality to display the data in each listbox, and move a record into the second box fromm the first. I want the user to be able to move the records up and down( they are ranking them). Does that make any more sense?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1500 total points
ID: 24030907
If you are binding a ListBox to a DataTable, and you want to control the order of the items in the ListBox, then I would suggest adding an Integer sorting column to the DataTable, creating a DataView from the DataTable, and then bind the ListBox to the DataView, with the Sort property set to the sorting column.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question