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

GridView AutoGenerateColumns detect image URL

2 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 22 Jun 2012, 01:53 AM
Is there some way that the GridView could detect that a column value was an image url while in AutoGenerateColumns = True mode?
I have a data source that has a lot of regular data and one column that is a thumbnail of the product image.  I know I can set AutoGenerateColumns = False and create a column for each individual data element but it would be nice if AutoGenerate could detect that a data element was an ImageColumn and use the URL in the data as the source.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 22 Jun 2012, 05:52 AM
Hi Chris,

You can try to handle AutoGeneratingColumns event of the grid and perform the logic you require inside.
Let me know in case you need further assistance with that. 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Chris
Top achievements
Rank 1
answered on 27 Jun 2012, 10:10 PM
Thanks.  That worked, I just added this to the AutoGeneratingColumn method:

e.Column = new GridViewImageColumn() { DataMemberBinding = new Binding("ThumbnailURL") };
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Maya
Telerik team
Chris
Top achievements
Rank 1
Share this question
or