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

Conditionally Display Image for Column

2 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Loretta Stokes
Top achievements
Rank 1
Loretta Stokes asked on 16 Apr 2010, 09:58 PM
I have a column defined as a GridViewImageColumn. The data I am returning back is a status flag. I want to show an image depending on the flag (1= information image,  2=warning image, 3=error image,). Does anyone have an example using xaml and or code behind?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 19 Apr 2010, 08:24 AM
Hello,

You can do this using IValueConverter for the DataMemberBinding and return desired image in the Convert method depending on the current value.

Greetings,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Loretta Stokes
Top achievements
Rank 1
answered on 21 Apr 2010, 07:23 PM
Thank you. I was aware of the IValueConverter but I didn't know it could be used for an image.
Tags
GridView
Asked by
Loretta Stokes
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Loretta Stokes
Top achievements
Rank 1
Share this question
or