Hi there,
I'm looking for some advise on getting an image into my wingrid cell correctly. I have tried a few different things with some strange results, most likely I'm missing the point somewhere along the lines...
OK I have a grid (always a good start), a column called priority (with values like high, medium, low etc). When the grid row is initialised I find the priority cell's value. If the cell is high I want to replace the text in the cell from the word "high" to an exclaimation mark image (16x16 png).
So...
public void gridTasks_InitializeRow( sender,... e )
if ( myValue.ToLower() == "high" )
{e.Row.Band.Columns["Priority"].CellAppearance.Image = Icons.exclaimation_red;//e.Row.Band.Columns["Priority"].CellAppearance.ImageBackground = Icons.exclaimation_red;
e.Row.Band.Columns["Priority"].CellDisplayStyle = CellDisplayStyle.FullEditorDisplay;//e.Row.Band.Columns["Priority"].CellButtonAppearance.Image = Icons.exclaimation_red;
e.Row.Cells["Priority"].Value = "";}What's really strange is I can step through the debugger and see myValue is "high", every 3rd or 4th row but every row comes back with the priority column cell with the image in it. I don't think this is the best way of applying the image to a cell so is there a better way?
// e.Row.Cells["ImpactId"].Appearance = grid.DisplayLayout.Appearances["Positive"];
Cheers,John
Hello,
It took me some time to figure out my problem. I use v9.2.
I have to set the property Style and CellDisplayStyle to fix the problem.
UltraGrid.DisplayLayout.Bands(0).Columns("MyCol").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Default
UltraGrid.DisplayLayout.Bands(0).Columns("MyCol").CellDisplayStyle = Infragistics.Win.UltraWinGrid.CellDisplayStyle.Default
Thx
I did a little more digging and this was fixed back in v9.1 and up, so unless you are using a very old version of the controls, you should just get the latest service release to fix the issue.
Hi Marleen,
I could be wrong, but I am pretty sure this bug was fixed a while ago. What version of the grid are you using? Do you have the latest service release?
How to get the latest service release - Infragistics Community
I also like to filter on al column containing images.
Is there another approach to overcome this bug?
May be I can define the column to display images, but define the filter to display text and use the text for filtering? But how to I handle this approach?
Thanks,
Marleen
Hi Mark,
I tried this out and I get the same results. As long as I don't set the DisplayStyle on the ValueList to Picture, it works fine, but once I set it, it fails to filter correctly.
This looks like a bug to me, so I'm going to forward this over to Infragistics Developer Support so they can check it out.