We are trying to use a boder around the row to indicate the active row. We have it working using a DrawFilter to draw the border after the row is drawn. It is working...but it is hard to get a border bold enough to make it clear that the row is active without some other UI element over-drawing part of the border.
Is there an easy way to use a CreationFilter (or something else) to inflate a grid element's size? I would like to make some clear space available for a 2 pixel border around the entire RowUIElement so that it is not drawn over by the cell or any other sub element. Here's a picture of what I am having happen currently when a cell is in edit mode.
I used RowSpacingBefore and RowSpacingAfter to open up some space then moved my border drawing into the AfterDrawElement of the RowColRegionIntersectionUIElement. Between those two suggestions I found something that worked. I'd still be happier if I could contain my code to the row element, but what I ended up with seems to be working.
Thanks!
Hello mathdx,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
Hi,
I tried this out just to see if I could get it to work, and I ran into a problem because changing the active row in the grid only invalidates the row and not the area into which you would draw the border. So I got around it by calling Invalidate on the grid any time the ActiveRow changes.
I'm attaching a sample here so you can check it out. Seems to work okay for me.
I can give that a shot.
Okay... you are probably drawing at the wrong time, then.
I don't know if you are aware of this, but the grid has built-in functionality to draw a border around the selected rows (not ActiveRow). And the way the grid does it is, it uses the AfterDrawElement phase of the RowColRegionInterSectionUIElement. This is the element that contains the rows. So that way, all of the rows in the grid are already painted before the border is drawn on the selected rows and nothing can draw over it.