datagrid - speed loading

G

Guest

Hi,

Currently i am loading the file names into datagrid (unbound) from a
folder(sub folders too). so for this i am using this below code. but its too
slow to loading all the file names. is it any other method to make it fast
loading

bala

code:

Dim files() As String = Directory.GetFiles(mylocation)
Dim folders() As String = Directory.GetDirectories(mylocation)
Dim folder
Dim str() As String, intx As Integer

Try

For Each folder In folders
' lstFiles.Items.Add(folder).ToString()
Dim subFolders() As String
str = Directory.GetFiles(folder)
For intx = 0 To str.Length - 1
......
 
R

Robby

Fill an Array or an ArrayList then assign that to the DataGrid. You could
also use a ADO DataSet object if you want but I think that it would be
overkill since your DataGrid is unbound. One of the above will have the
effect of an empty DataGrid suddenly appearing full.

--Robby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top