Hi,
We implemented our own merging capabilities and we have one issue with cells set as checkbox or button: when the cell is being suppressed, we still see the checkbox or button. How can I prevent them from being shown?
Thanks.
AnnieP.S. We are using NetAdvantage 2009 vol.1.
Hi Annie,
It's hard to answer your question since you didn't provide any details about how you are accomplishing the merging. I assuming you are using a CreationFilter, so the thing to do would be to remove the UIElement for the cells you don't need.
Hi Mike,
We created a custom DrawFilter for the grid. This filter handles the painting of the cell border. If the cell is "merged", we set the border color to be the same as the background color.
For the text of the cell, we play with the 'Foreground.Alpha" of the cell appearance. This is something we want to review as it seems very costly on our grids with lot of rows.
I tried working with a CreationFilter as you suggested but I was not able to make it work fine. When I double-click in a cell to change its value, I could not see the checkbox. I am guessing it is because the UIElement was removed...I will continue to investigate (this is an area I am not familiar with; someone else wrote our merge functionality and the person is not longer working for us!).
If you have anything else to suggest, let me know.
Your help is appreciated.Annie
This approach doesn't sound like a good way to do things. You would be better off using a CreationFilter and simply resizing the CellUIElement to span the area of the other cells and then remove the CellUIElements for the cells which are no longer needed.
The tricky part of this is that you have to use the CellUIElement for a cell that is in view. So if you have three cells in a row that you want to merge, you can't always assume that the first cell will have a UIElement, because that column might be scrolled out of view.
I took a much simplier approach by using the "IMergedCellEvaluator" interface.Works better than what we had in the first place and our code is cleaner and faster.
Thanks for your help.
Annie