DataGridView Icons in Cell - Does it work the same in WiseJ 3 ?

0
0

In WiseJ 2 we used to add icons to a DataGid Row’s Column to allow the user to perform actions on that row – like delete, view more info, etc..

We used to se the column to Allow HTML then add some string to the column in the row like this:

string is_Delete_Action = @”<img role = ‘delete’ title =’Delete Guardian’ src=’resource.wx/Wisej.Ext.FontAwesome/times-circle-o.svg?color=red’ class=’cell-image’/>”;

 

I’m trying this in WiseJ 3 and it just shows a blank cell. Is this method still supported in Wise J 3 ?

  • You must to post comments
0
0

Reposting because it got cut off:

If you use the fontawesome characters you can set the color like so:

var iconHtml4 = "<i style=\"color:red\" class=\"fa-brands fa-github\"></i>";

If you do that, you need to add this to the head in Default.html:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"/>

 

See attached sample

Attachment
  • You must to post comments
0
0

It does still work in Wisej 3.

Try this: string is_Delete_Action = "<img style='width:16px; height:16px' src ='resource.wx/Wisej.Ext.FontAwesome/times-circle-o.svg'/>";

Some things to note:

  1. ?color= doesn’t do anything in the URL. It can only be used with wisej widgets not HTML. There is nothing in the svg that changes the color, it’s a feature of wisej widgets.
  2. The img element doesn’t set the size so you get icons that are way too big since svg are usually designed larger. Thus you need to manually set the size.
  • Julie(ITG)
    Role is fine, I just didn’t put it in my sample code to keep it simple
  • Julie(ITG)
    Also note that if you use the fontawesone characters you can set the color: var iconHtml3 = “”; You need to edit Default.html and put this in :
  • edmond girardi
    Looks like your last post was cut off – not showing. I was able to get the size in there and now i ca see the icons
  • edmond girardi
    I checked my old WiseJ 2 code and definitly whatever is returning the resource in WiseJ is also setting the color using :src=’resource.wx/Wisej.Ext.FontAwesome/times-circle-o.svg?color=red’ ” I tried setting the color as part of the style but it does not do anything
  • Luca
    • Luca
    • Jan 14, 2026 - 1:46 am
    The recoloring has always been done in javascript in the browser. You can user the embedded svg resource as a src for img but it will not recolor. It never did. It only works with Wisej.NET widgets ImageSource property. In alternative you can use the font character icons and in that case only you can use the color style since it’s a character and not an img.
Showing 2 results
Your Answer

Please first to submit.