I am using ultragrid 9.1. I am displaying the details as cardview. I can change the back color of the card caption by using the following property:
Ultragrid.DisplayLayout.Override.CardCaptionAppearance.BackColor = System.Drawing.Color.Red
However, I want to change the back color of the caption conditionally and not for all rows. I am unable to find the relevant property to set this.
My problem has been solved. There is no in built property that could be used to set the background color of the caption. I had to use the DrawFilter interface.
You can find more information about this interface from this link:
You should create a class that implements IUIElementDrawFilter. In the GetPhasesToFilter method of the interface check if the element is CardCaptionUIElement and if it is return its BeforeDrawBackColor phase. Then in the DrawElement method you can draw the background using the DrawBackColor method of the drawParams argument.
Then, set the drawfilter for the ultragrid.