Folks,
I have a ultrawingrid 8.2 with couple of columns having a dropdown to allow users to select a value from it. The dropdown (ultradropdown) is bound to the grid cell by setting the valuelist property for the column in the grid. The columns are mandatory and if user does't enter a value, i have to highlight the cell in red color (some color).
I tried to set the cells.appearance.backcolor = color.red, but it doesn't take effect. Is it because of the valuelist bound to the cell. Is there any other way to show some colors in the dropdown bound cells?
Hi,
Are you using AppStyling?
A cell in the grid will pick up the appearance of the selected item in the dropdown. Most of the time, there is no appearance applied to the dropdown cell, so you should normally be able to color the grid cell without a problem.
But if you apply an appearance to the dropdown cell either in code or via appstylist, the dropdown cell's appearance may be overriding the grid cell's appearance.
All of this assumes that there is an item on the list that matches the cell's value, which in this case is null. So maybe I am on the wrong track here.
Valid point Mike. I don't use any appstylist or any appearance to the dropdown, but i'm not able to set back color to the cells. I'm setting the column style of the grid to dropdownlist. Is that a reason ?
No, that should not make any difference.
I just tested this out and it's working just fine for me. There must be some other factor at work here that we are missing.
Can you duplicate this in a small sample project?
I'm attaching a sample project with the same grid settings that i had i my project. Run the .exe and click submit button.
Okay, I ran your sample and I see the problem.
It doesn't seem to have anything to do with the ValueList, though. Removing the ValueList from the column makes no difference.
It seems like the issue here is that you have an ActiveRowAppearance applied to the grid and this is overriding the appearance on the individual cell in the row. So you need to take off your ActiveRowAppearance on band 0 that your code is applying.
Also, the grid has a default ActiveRowAppearance applied, so you have to get rid of that, too.
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
You hit the nail on its head ! I have to give it to you.
I was overriding the active row appearance in initialize layout. I removed it and reset the active row and active cell apperances. It worked like a charm. Thanks a ton.