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

[Solved] Conditional Image/Icon in Cell

1 Answer 189 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ernstjan
Top achievements
Rank 1
Ernstjan asked on 23 Feb 2011, 03:54 PM
Hello,

I'm struggeling for some time now with the following.
I have several GridViews in my application, in some of them I'd like to show an icon/image in a cell based on a value in another cell/column. (for example, if a date is < today I want to show an icon with a red cross, when the date is almost < today I want to show a yellow triangle)

Right now I'm using a StyleSelector (either CellStyleSelector or RowStyleSelector) to change the fore or background, which works fine, but I prefer to show an image.

Can anybody help me out?

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 01 Mar 2011, 07:53 AM
Hello Ernstjan,

You may try implementing a TemplateSelector, which could define the CellTemplate of your column. You can easily  nest your custom logic into it, in order  to chose the images that would be displayed. Please, refer to this article: CellTemplateSelector.


Regards,
Ivan Ivanov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
GridView
Asked by
Ernstjan
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or