Tree Grid View (TGV): How I can render a cell as an icon/image?

Hello,

I have a question regarding the TreeGridview.

We need to set different row icons on a TreeGridView based on a ItemType property called kind of "xx_type".

We already have a TreeGridview that uses the ItemType icons but they are too generic and we need to replace them
based on a property called "xx_type".

I am thinking of 2 possibilities:

1. Render a new cell as an icon/image. Is it possible? As I see, the designer doesn't offer this possibility.
2. Replace the existing Icons dynamically using a client method. Is there a possibility to do that?

I would prefer 1'st option,I think second option is by far most complicated.

If somebody knows and can help I would really appreciate that.

Thank you.

Parents
  • Adding a second image column is theoretically possible but not easy to do. You would have to duplicate the item indicatior column.

    Another approach may be the modification of the column mapping in the Column definition. By default, it´s set to a static icon. But you could manually change it to a property that contains the new icon:

  • Thank you, I was unaware you could use an image property on the item as the Icon in tree grid.  I have managed to get somewhere close by creating an image column which can then be used as the icon which I populate in advance of running the query. 

    Can you create the image dynamically at run time? I.e. if you don't know the property until the query is run. Such as a Part BOM, where you don't know if a part is a parent or a child until the context item is passed to the query.

Reply
  • Thank you, I was unaware you could use an image property on the item as the Icon in tree grid.  I have managed to get somewhere close by creating an image column which can then be used as the icon which I populate in advance of running the query. 

    Can you create the image dynamically at run time? I.e. if you don't know the property until the query is run. Such as a Part BOM, where you don't know if a part is a parent or a child until the context item is passed to the query.

Children