# Computed data column

**URL:** <https://forum.radzen.com/t/computed-data-column/1848>\
**Category:** Uncategorized\
**Created:** [October 25, 2019, 3:18pm UTC](https://forum.radzen.com/t/computed-data-column/1848 "2019-10-25T15:18:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geoxp](https://forum.radzen.com/user_avatar/forum.radzen.com/geoxp/32/1567_2.png) [@geoxp](https://forum.radzen.com/u/geoxp)\
**Post date:** [October 25, 2019, 3:18pm UTC](https://forum.radzen.com/t/computed-data-column/1848/1 "2019-10-25T15:18:30Z")

</div>

Hi,  
(blazor)

I am using a REST data source and want to display a status icon in a grid data column.  
Depending on a int value , to show a red, orange or green status image.  
I tried to set a variable in the rowselect event, but then all rows change to the actual value:

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/b7bf841fe260116ca098eb7b49f59d13ca9bf12d.png)

different row:

 ![image](https://forum.radzen.com/uploads/default/original/2X/b/b002e2d7fbaff6ad04230e980b7d7281ffe9a36f.png)

Is is possible to add a computed column to the datasource or any other proposal ?

Regards  
Gerald

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 25, 2019, 3:29pm UTC](https://forum.radzen.com/t/computed-data-column/1848/2 "2019-10-25T15:29:36Z")

</div>

Hi Gerald,

In my opinion the best way to achieve this is to define Template for the column with your logic.

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![geoxp](https://forum.radzen.com/user_avatar/forum.radzen.com/geoxp/32/1567_2.png) [@geoxp](https://forum.radzen.com/u/geoxp)\
**Post date:** [October 25, 2019, 3:55pm UTC](https://forum.radzen.com/t/computed-data-column/1848/3 "2019-10-25T15:55:41Z")

</div>

Hi Vladimir,

I used a the column template and added a image control.  
How can i add logic to the path proberty ?  
Or do you mean some different template ?

Reagrds  
gerald

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [October 25, 2019, 4:03pm UTC](https://forum.radzen.com/t/computed-data-column/1848/4 "2019-10-25T16:03:38Z")

</div>

You can have for example three images and show/hide them based on some value with expression for image Visible property.

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [October 25, 2019, 4:22pm UTC](https://forum.radzen.com/t/computed-data-column/1848/5 "2019-10-25T16:22:35Z")

</div>

Setting the Visible property to an expression is demonstrated [here](https://www.radzen.com/documentation/blazor/crm/customize-crud/#add-icons-in-the-tasks-datagrid).

---

<div class="post-metadata">

**Author:** ![geoxp](https://forum.radzen.com/user_avatar/forum.radzen.com/geoxp/32/1567_2.png) [@geoxp](https://forum.radzen.com/u/geoxp)\
**Post date:** [October 28, 2019, 8:35am UTC](https://forum.radzen.com/t/computed-data-column/1848/6 "2019-10-28T08:35:15Z")

</div>

HI,  
I tried to cascade the conditonal operator. (? : )  
If i have just 2 values, then it works:

 ![1%20different%20status%20values](https://forum.radzen.com/uploads/default/original/2X/7/79a2f3809c6453a2b727be26fcbcc7a6c14ce801.png)  
If i try to have more different values, i get an error message:  
 ![2%20different%20status%20values](https://forum.radzen.com/uploads/default/original/2X/a/a4e079697e6060a5dbd297568e049f1d39bfdc60.png)

![2019-10-28%2009_33_23-Radzen](https://forum.radzen.com/uploads/default/original/2X/f/fc5224d25688a8bf50c4d9808e93c1e749890eac.png)

Thanks  
Gerald
