All Answers

All Answers » Re: Can I add Multiple icons (images) in a single Datagrid view Cell - all with separate click Events » Comments for "Re: Can I add Multiple icons (images) in a single Datagrid view Cell - all with separate click Events"
  • edmond girardi
    Can you give me a sample with the code ? When I tried this all i get is the HTML in the datagrid cell – it does not render the icons. I am retieving data from the database, then adding a column to the data table and assigning the html from your post: DataColumn dc = new DataColumn(“Actions”); dc.DataType = typeof(string); dc.DefaultValue = “”; (sorry – HTML does not show but its what you have above.) ldt_Data.Columns.Add(dc);
  • Luca (ITG)
    You have to set col.AllowHtml = true; Anytime you want to use HTML in Wisej controls the AllowHtml property have to be true, otherwise the html tags are not encoded since normal text may have the greater than and lower than operators as part of the text.
  • edmond girardi
    Yes, that fixed it. Now – one more question – can I use the built in “icons” the ones in the font packages instead of having to put actual images in the folder ?
  • Luca (ITG)
    Yes for the icon packages, not for the theme icons. For the icon packages use the same url that comes with the static class: i.e. Wisej.Ext.MaterialDesign.Icons…. You can either use the full path resource.wx/Wisej.Ext.MaterialDesign/back-arrow.svg or the short path resource.wx/back-arrow.svg. In the second case, Wisej will return the first back-arrow.svg resource that it can find in the resource assemblies.
  • edmond girardi
    Tried it with ElegantIcons. Compiled the extension project and put the DLL in my project folder, added a reference to it. Using img role=’test’ src=’ resource.wx/Wisej.Ext.EleganIcons/archive-box.svg’ – i just get the “X” in place of the image in the grid. The click even does work however. Just trying to sort out the graphic issue,
  • Luca (ITG)
    You have the wrong name EleganIcons instead of ElegantIcons. The “t” is missing. Also, since the images are svg images in an img element you can’t change the color. Wisej changes it by loading the svg xml document and changing the fill. Another option you have if you want to change the color is to use a real font icon set, which would work exactly as in any HTML page. Or you can change the color in the svg itself and save it back.
  • edmond girardi
    Luca, I corrected the spelling – but still no luck. Now the cell is blank – does not even show the “X” like before.
  • Luca (ITG)
    Can you send me a .cs file with the string? I tried it and I get the correct image.
  • edmond girardi
    Where do i send the .cs file ? I cant attach it here
  • Luca (ITG)
    In a .zip or send it to support[at]wisej.com.