We have an Ultragrid where, on certain rows, a particular cell's text needs to be invisible. We originally accomplished this by making the row's cell Appearance and Selected Appearance forecolor to be equal to the back color, thereby resulting in a seemingly blank cell. We have since instituted an isl file and now the cell's text is displayed when 1) the mouse hovers over the cell or 2) the row is selected. How can we retain the blank appearance of these cells under those conditions? Thanks
Ron
Hi Ron,
Set the Hidden property on the cell to true.
That works except for one thing. The cell's back color is supposed to be a different color than the other grid cells, and that color is not showing when it's hidden.
If it's a tooltip showing up, then you could turn off the tooltips on the column using the TipStyleCell property on the column.
The auto size works. I was auto sizing the wrong column. Once I auto sized the correct column, everything is working now. Thanks.
Well I found out why the hover displays the text. It's because the text length is wider than the column width. I added PerformAutoSize but that doesn't work because the cell also has an edit button on it. How do I add the width of the Edit Button to the column width and auto resize the column?
Well that sounds a bit much for something cosmetic. We did get the Selected Row to not show the text by making the cell's ActiveAppearance.ForeColor = Color.Transparent. We're still left with the mouse hover still displaying the text almost like a tool tip- it goes away if you leave the mouse stationary on the cell. I've tried the MouseEnterElement and MouseHover events to try to keep the text from not displaying but it doesn't help. What causes the cell text to display when the mouse is over it? Thanks.
Well, that makes things a lot more difficult if you need the cell to display it's background, but not it's content. I guess one easy thing you could try is setting the Style on the Cell to Image. The image editor won't be able to interpret the cell's content as an image, so it will just show a blank. But that might have an effect on performance.
An alternative would be to use a CreationFilter to prevent the CellUIElement from creating any contents.