Solved

ASP.NET - How do I reset a list box's data source to null?

Posted on 2011-03-14
3
604 Views
Last Modified: 2012-05-11
In the image below, the Reports list box is populated when the user selects a value in the Report Category DDL.  I'm working on the code under the Reset Button.  I want to Reset the list box data source to null.  (I want the Reset button to make list box to appear empty.)  How do I do this?
Reset-List-Box.png
0
Comment
Question by:jdana
3 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 35126839
add this code on reset

  ListBox1.DataSource = Nothing
        ListBox1.DataBind()
0
 

Accepted Solution

by:
royshantanu20001 earned 250 total points
ID: 35126904
Use This,



listBox1.Items.Clear();
0
 

Author Closing Comment

by:jdana
ID: 35126976
Thanks!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now