473,383 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

clear the listBox

I have asp:listBox and I tried:

lstAdvPos.ClearSelection()

lstAdvPos.DataSource = Nothing
lstAdvPos.DataBind()

lstAdvPos.Dispose()

Nothing helps, listBox is still full.

How can I clear it, delete all items from it?

Thank you,

Simon
Nov 18 '05 #1
1 1285
Hi,

lstAdvPos.Items.Clear()

should do the job.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"simon" <si*********@stud-moderna.si> wrote in message
news:uv**************@TK2MSFTNGP10.phx.gbl...
I have asp:listBox and I tried:

lstAdvPos.ClearSelection()

lstAdvPos.DataSource = Nothing
lstAdvPos.DataBind()

lstAdvPos.Dispose()

Nothing helps, listBox is still full.

How can I clear it, delete all items from it?

Thank you,

Simon

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
0
by: Hohn Upshew | last post by:
My problem is that after chosing an order from the list and open a report, the form stays with the number of the customer for that number and cannot be requeried.How can i clear the form? This is ...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
1
by: Paul | last post by:
I have a list box that I am populating with a dataset. It looks like ******** * Ted * * Sam * * Lori * These values come from a table, used a stored procedure to fill a dataset....
5
by: Ariel | last post by:
¿Some body could tell me wich is the new method of listBox control in VB .net is equal to old and wanted "Clear"?
0
by: Lloyd Sheen | last post by:
1st let me apologize for creating new thread but using Windows Mail and old one is gone all read. What I was asking if there was a "generic" method of capturing control events and doing the...
1
by: Gerardo ARnaez | last post by:
Hi. I am writing a program to help determine coumadin regimens to look at the code: http://sourceforge.net/projects/coumadinregimen/ The issue is that I have a variable that I want the use to...
7
sassy2009
by: sassy2009 | last post by:
Hello All, i have a listbox control named lstDisplay. I have added items to the list using the additem method. But when i tried clearing the listbox using Clear method i cannot find it. i searched...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.