File Listing with Image (type), File Name, Size, Gridview

I am trying to generate a list of uploaded (attached) files to an form in ASP.NET
an example:
class object UploadFileItem
attributes:: string FileName, string FileSize, Image FileTypeImage

I have been able to generate an IList of itmes UploadFileItem
but if I use something like a GridView control, I can bind the IList, but only the string data is displayed and the Image attribute is just ignored.

The actual images are small bmp files and are assigned based on the file extension.

I am trying for the simplest code behind solution in c# so that I can populate an IList with objects, and bind the control to display the graphic, file name, date and size (basically mimicing an explorer list of files. (xls has Excel Icon, .doc Word Icon, etc)..

I've run across a lot of topics on Google, but none seem address a file listing.


I have tried changing the attribute for TypeImage to string, and setting an image url path based on this,  but still can not find a way to bind into the grid.

I'm new to c# and asp.net, so for all I know I'm using an inappropriate control.
sdnoyesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RejojohnyCommented:
do you have a template column to show the image and if yes, can you post the code for the template column ,..

is this what you are trying to do .. just that the datasource you have is a custom object and not dataset ..
http://msdn2.microsoft.com/en-us/library/aa479350.aspx

Rejo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sdnoyesAuthor Commented:
This looks like just what I needed.  Once I adapt and test I will accept  the solution and award points.
originally I was binding to an array of objects, but this is a pretty clear explanation of creating a Data Table, and should be easily adaptable.

I will let you know the result later today.
0
sdnoyesAuthor Commented:
This worked.  I had to modify a bit for my purposes:
Since I have several GridViews, and will populate them with fetched info I modified to set the datasource and bind programatically:
gvImageList.DataSource = GetFileList();
gvImageList.DataBind();
  //Page.DataBind(); old Binding.

Thanks,
You were a lot of help.
0
sdnoyesAuthor Commented:
Thanks again.
I never ran across this iin any of my Google searches.
Usually I run into more garbage than answers to .net questions using Google.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.