Need a little direction please...
I have been asked to draw a cell as black on black (redact the cell) unless on a specific row type. Now if the cell was plain text... its a piece of cake; however, the column is a T/F value and gets a checkbox editor control. No matter what I do to the ForeColor and BackColor or Enable/Disable, the edit control remains "visible." Make matters worse, I have not found how I might get at the edit control's Visible property.
Any idea how I might effect this desire? Do I create an unbound column and manually add the edit control to the cell or ??? Sure could use a hint or 2 or 3...
Thx,
Brian
Hi Brian,
Does it have to be black on black? Or do you just want to hide the checkbox?
If the former, then I'd use a CreationFilter to replace the contents of the cell with a single UIElement and give it a solid background.If you are not familiar with CreationFilters, then this will be a bit tricky for your first one, but I can help you along with some sample code if you need it.
If you just want to hide the checkbox, then this is incredibly easy. All you have to do is use the InitializeRow event and set the Hidden property on the cell based on some other cell values in the same row.
OMG is all I can say.
I was looking far deeper than I should have. My latest attempt was changing CellDisplayStyle and hopefully the cell Activation property to enable/disable the edit control. But quickly learned Activation is not a cell property. Ugh. :-) I know I must have looked at the Hidden property many times; but, kept thinking... no I don't want to hide the cell, I want to make the checkbox in side not visible.
As for color... I suspect Gray and no visible control will be OK with the Product team. Will play with the cell Appearance properties a bit to see if I can reach the black color they desire.
Thx for the re-pointing and pulling the leash back. Sometimes get caught by details and don't see the forest for all the trees.
Hello Brian,
Thank you for your feedback.
Please do not hesitate to contact us when you have any questions.
Danko, Mike,
I have not had a chance to code the CreationFilter, DrawFilter, or try the RowAppearance.BackColor property ideas. I will give them a go... hopefully before weeks end. The concept desired by Product is on a next build design and I was trying to pull ahead while at a "slow point." Then again, I may not need either as the gray color of the inactive cell does not look bad at all... at least to me.
Once I have a moment to code the proof again, I will report back. I suspect each will have merit and function to get the desired effect. "Your" answers have never steared me wrong.
Please let us know if you have any further questions.
When you make the cell hidden, the gray background you see is the background of the row. So you could simply set the RowAppearance.BackColor.
I think the visible cells will also pick up this color, though, so you might need to also set the RowCellAppearance to color the visible cells. I'm not sure if this can be done through AppStylist, but I don't think so.
A DrawFilter directly controls the drawing of the objects on-screen, so it will override any application styling or property settings you apply.
TY Danko,
If I must get the black background color, I will give this a shot. Currently the gray cell color is acceptable. I was wondering if the color could be influenced by AppStyle and or how does the filter affect styling?