Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Listbox items

Status
Not open for further replies.

ravula2000

IS-IT--Management
Mar 8, 2002
205
US
Here is my code
Dim mcSourceDir As String
drpListFiles.Items.clear()
Select Case pnImpType
Case 2
mcSourceDir = "c:\temp"
Dim dirinfo As New Directoryinfo(mcSourceDir)
drpListFiles.DataSource = dirinfo.GetFiles("*.*")
drpListFiles.DataBind()
End Select

Once pnImpType =2 I am getting list of files in c:\temp directory in the listbox. Next time when pnImptype=0 I need to clear all the items in the listbox.
But the list box still retain its values from c:\temp directory. How can I clear the items.

Thanks
Srini
 
Not sure about this one...only using logic...

Dim mcSourceDir As String
drpListFiles.Items.clear()
Select Case pnImpType
Case 2
mcSourceDir = "c:\temp"
Dim dirinfo As New Directoryinfo(mcSourceDir)
drpListFiles.DataSource = dirinfo.GetFiles("*.*")
drpListFiles.DataBind()
Case 0
drpListFiles.Items.Clear()
End Select
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top