Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
490
UltraGrid displaying empty cells
posted

I have an UltraGrid where the values are integers (ids).

I have a ValueList which maps the ids to strings.

Some cells need to be empty. In those cases, the values are -1. I tried to map -1 to string.Empty, but I figured that ValueListItems.Add ignores string.Empty as an argument.

I tried another trick, by setting the foreground = background in those cells. However, when I hover with the mouse over those cells, -1 is displayed, as you can see in the screenshot. The cell above the highlighted row also has the value -1, but it is not displayed, which is the result I desire.

cell.Appearance.ForeColor = cell.Appearance.BackColor;
cell.SelectedAppearance = cell.Appearance;
cell.ActiveAppearance = cell.Appearance;
cell.ButtonAppearance = cell.Appearance;

I tried hiding the cell when the value is -1, but then the background becomes gray. We want the background remain white.

Is there a way to display a white background and hide the value -1, in all cases?