Hi. My application places an image in a grid cell under certain conditions. That works great. Here's the code that sets the image:
row.Cells[variable.Name].Appearance.Image = imgimageListNoData.Images[0];
Could someone please tell me how to clear the image? When the users enters data into the cell, I'd like to show the data - not the image.
Setting the image value to null isn't working:
row.Cells[variable.Name].Appearance.Image = null;
How is this accomplished?
Thanks.
That is the way to clear the image. One possibility is that the same image is specified on an appearance higher up in the resolution hierarchy (for example, on the UltraGridColumn.CellAppearance for that cell's column), so clearing it on the cell makes no difference since they are the same.
Brian,
Thanks for the reply. Maybe I should be more specific. What happens is that the image goes away, but the data appears in the upper right corner of the cell above where the image used to be. It looks like the cell still thinks there's an image there and renders the numeric value above it.
How do you reset the cell appearance so no trace of the image is left?
Here's what it looks like on screen...
Hello,
I am just checking about the progress of this issue. Did you solve your issue accordingly to the information that Michael provided you?
Let me know if you need any further assistance.
Thank you for using Infragistics Components.
Hi,
I'm afraid you lost me. I assume you are referring to the cell with the value "46" in it. But this cell looks just like every other cell in that column and the text is aligned the same way. Having applied and then removed the image doesn't seem to have had any lasting effect on the cell - at least not that I can see in this screen shot. All of the other cells in the column have their text aligned exactly the same way.
So I don't really understand your question.
If you want to change the alignment of the text in the cell, you can do that using the TextHAlign and TextVAlign properties on Appearance for the cell or column.