This is a migrated thread and some comments may be shown as answers.

Binding Object to RadGrid

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 30 Aug 2008, 11:46 AM

Hi,

I'm beginning to learn how to use the RadGrid control, but really don't know where to begin. I am developing a test page where the RadGrid should populate from the following object:

public class GalleryDTO {
private string mName;
private string mDescription;
private string mUrl;
private string mThumbnailUrl;

//.. Below are read/write properties for the above fields, and constructors.
}

Now, I have a method that returns a List<GalleryDTO>. How
can I pass this list to the RadGrid so that it can populate itself.

Each GalleryDTO object should be displayed in 1 cell where the
mThumbnailURL is a url to an image that is to be displayed in
that cell, and the mUrl is the url to be redirected when clicking
on that image.

Any guidance on where to start or to a sample project would be great.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 01 Sep 2008, 01:41 PM
Hello Robert,

You can provide this generic list directly as DataSource for the grid in NeedDataSource or you can use ObjectDataSource. Please check these examples:
http://demos.telerik.com/aspnet/Prometheus/Grid/Examples/Programming/Binding/DefaultCS.aspx
http://demos.telerik.com/aspnet/Prometheus/Grid/Examples/Programming/CustomPaging/DefaultCS.aspx

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 02 Sep 2008, 12:59 PM

Hi,

Thanks for the examples, I will take a look at them now. Just
a short follow up question though.

Does the RadGrid support the display of images from a Bitmap
or Image variable directly or does it need to be handled in
some other way?

Thanks!

0
Vlad
Telerik team
answered on 02 Sep 2008, 01:13 PM
Hello Robert,

Please check this code library for more info:
http://www.telerik.com/community/code-library/submission/b311D-mbmbb.aspx

Sincerely yours,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Robert
Top achievements
Rank 1
Share this question
or