If I have certain rows that I want to change the font color, while the whole UltraGrid is using a style library, how do I do that? I tried to set the CellAppearance.ForeColor to that row, but it didn't change. How do I overwrite Stylelibrary settings for a specific row?
Thanks.
Richard Zhu
Hi Richard,
rzhu said:My understanding is that no matter where you set the ValueList foreColor, you are setting it for the whole column, meaning that all the cells in that column will be red. This is different from what we want. We just need certain cells in the column to be red. That's why I said the only way I can think of is to set each cell's Appearance.ForeColor of specific rows to red.
Okay... I don't think you understand what I was suggesting.
If you set an appearance on a ValueListItem (an item, not the whole ValueList), and then you select that item in a cell in the grid, the grid cell will pick up the appearance of that item.
If you set an appearance on the ValueList (the whole list, not a single item), then the appearance will apply to the items on the list, but it will not get picked up by the cell.
So, as I said earlier, what you need to do is open up the isl file and go to the ValueListItem UIRole and reset it so it does not apply any appearances. Then, if you want to apply setting the items on the list, you can apply the same settings that were applied to the ValueListItem role to the ValueList role instead.
Unless I am wrong about all this, of course. Are you saying that you tried this and it doesn't work?
Sorry for jumping around. Here's the full picture:
My understanding is that no matter where you set the ValueList foreColor, you are setting it for the whole column, meaning that all the cells in that column will be red. This is different from what we want. We just need certain cells in the column to be red. That's why I said the only way I can think of is to set each cell's Appearance.ForeColor of specific rows to red.
I hope this clears up the picture, and appreciate all your help.
Richard
rzhu said: the problem with that is that ValueList belongs to UltraGridColumn. In our case I'm setting some rows to red based on the bound data, and leave other rows to their default color. So far the only thing I can think of is loop through row.Cells and set the Appearance.ForeColor for each cell to red. Anything more elegant?
the problem with that is that ValueList belongs to UltraGridColumn. In our case I'm setting some rows to red based on the bound data, and leave other rows to their default color. So far the only thing I can think of is loop through row.Cells and set the Appearance.ForeColor for each cell to red. Anything more elegant?
I'm afraid you have completely and utterly lost me here. What does the fact that the ValueList is on the column have to do with anything?
I thought you were using the InitializeRow event to color the cells. That's the best place to do it.
rzhu said:Now I just need to figure out a decent solution to it.
I think I gave you a solution, didn't I? You can apply the same setting to the ValueList role instead of the ValueListItem role and that should allow you to color the items on the list without affecting the grid cell.Does that not work?