Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 89361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:42:16+00:00 2026-05-10T22:42:16+00:00

I have several listboxes that get each of their data from a separate stored

  • 0

I have several listboxes that get each of their data from a separate stored procedure.

If the user selects an option in 1 listbox, it should filter the other listboxes.

I have done this before by adding logic to the stored procedure, but sometimes it seems to get very long.

Does anyone know of a better way to approach this?

The way I have it setup now is that for each ListBox, I have an ObjectDataSource which calls a method that calls a stored proc in the database to populate the listbox.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:42:17+00:00Added an answer on May 10, 2026 at 10:42 pm

    You can try changing the code so that instead of having the Listbox bind directly to an ADO.Net datatable, it binds to a DataView. DataViews can be sorted and filtered independently from the underlying DataTable they are based on…

    Assume LBStates is state ListBox, and lbCities is City ListBox, and dtCities is form level DataTable variable with all cities in it and it has a State Column…

         DataView dvCities = dtCities.DefaultView;       dvCities.RowFilter = 'State=' + lbStates.SelectedItem;      lbCities.DataSource = dvCities; 

    Wire up a selectedIndexChanged event to the States ListBox (in initializtion code)

     lbStates.SelectedIndexChanged += lbStates_SelectedIndexChanged; 

    and In the States ListBox SelectedIndexChanged event, add the same code…

      private void lbStates_SelectedIndexChanged(object sender, event e)   {      DataView dvCities = dtCities.DefaultView;       dvCities.RowFilter = 'State=' + lbStates.SelectedItem;      lbCities.DataSource = dvCities;   } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer As others have said you can't do what you are… May 11, 2026 at 12:36 pm
  • added an answer Anything between 50ms to 500ms would be good. This of… May 11, 2026 at 12:36 pm
  • added an answer I strongly recommend that you avoid the built-in date and… May 11, 2026 at 12:36 pm

Related Questions

I have several ASP:TextBox controls on a form (about 20). When the form loads,
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on
I have several tables whose only unique data is a uniqueidentifier (a Guid) column.
I have several old 3.5in floppy disks that I would like to backup. My
I have a form that contains a GridView control which is databound to an
I have a Page that has a single instance of a UserControl that itself
I have a server application that receives information over a network and processes it.
I’m porting a WPF app to silverlight 2, and have come across several WPF

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.