Issues with DataGrid control

A

Anthony Williams

Hi all,

Just a quick question. I'm populating a DataGrid control with a 'GetFiles'
collection I've taken from a directory. Basically, I have a directory full
of PDF files which people want to preview and print from the browser.

I've created a DirectoryInfo object, and have used the GetFiles method as
the data source of my DataGrid. All fine, and it works as expected - great.

Except that I can't put the standard paging on the DataGrid.

If I set AllowPaging to True and set PageSize to anything (we'll use 10 as
an example) whenever I try and switch pages, I get an "Index was out of
range" error:

== Index was out of range. Must be non-negative and less than the size of
the collection. Parameter name: index

I've not been able to find a cause for the problem, other than possibly that
the GetFiles collection doesn't have an index that I can use. Is there a way
around this problem (preferably in VB.NET!)

Thanks for your help,
Tone
 

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

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top