Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


web app - Sorting dropdownlists/datasets

Posted on 2004-10-28
Medium Priority
Last Modified: 2010-04-23

     I have:

1 dropdownlist called cmbSearchBy with two options: Nomenclature and Item ID
2 dropdownlists called cmbSearch1 and cmbSearch2, where 1 is bound to Nomenclature and 2 is bound to ID in the dataset that comes from the products table

Nomenclature (cmbSearch1) is in alphabetical order - when cmbSearchBy is used to choose Item ID, and cmbSearch1 disappears and cmbSearch2 appears, I want the Item IDs to all be listed in numerical order, and back to alphabetical when switched back.  I don't know how to do this - do I need to use something like a dataview?  If so, code?  Currently they both list by the way the select statement ordered the dataset (by nomenclature)


Question by:gleznov
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

eozz_2000 earned 1000 total points
ID: 12437303
I would use 2 dataviews (one for each combo):

dim dv as new DataView(yourDataSet.Tables("TheNameOfYourTable"))

and then, set the sort property:

dv.Sort = "TheNameOfTheColumn"

and then set the dataSource property of your combos to the dataView and set the DislplayMember property (I can't remember wich is that property in the web, but if you see all of them you will recognize it)

Author Comment

ID: 12443174
Thanks!  And thanks for the clarity of your answer :)


Expert Comment

ID: 12444738
Is good to know that my answer could help you

Featured Post

Technology Partners: 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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

609 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