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

show an image in a grid cell based on the grid cell value?

1 Answer 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 24 May 2011, 01:01 PM
Hi,

Is it possible to display an image in a grid cell based on the grid cell value. For example, if the cell value is say 'True/false', show a thumbs up or a thumbs down image.

Are there any inbuilt methods for doing this?

Or do we need to manipulate in the item_databound event?

Will there be performance issues if this is done for say (10 columns * 100 rows), i.e approximately 1000 cells?

Thanks,
Saravanan

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 May 2011, 01:49 PM
hi


<telerik:GridTemplateColumn>
                                <ItemTemplate>
                                   <asp:Image ID="imgCanAccess" runat="server"
ImageUrl='<%#  Convert.ToString(Eval("YourFieldName")).ToLower() == "true" ? "~/images/thumsUp.gif" : "~/images/thumdown.gif" %>' />
 
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
saravanan k
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or