Does AppStylist prevent DrawElement from firing? I have a grid using AppStylist and I want borders between column goups. The GetPhasesToFilter is firing which includes
if (drawParams.Elelemnt is CellUIElement)
return Infragistics.Win.DrawPhase.AfterDrawBorders;
However, DrawElement is not firing. How do I get DrawELement to fire. Thanks.
Ron
Okay, that sort of works, but the border alignment is off vertically, and the last grid column's border is thinner. At least I'm getting some of the borders. I think it's going to take a while to get it right. This seems like a lot of tweeking for column separators, but thanks as always for your help.
Hi Ron,
Sorry, it looks like your isl is turning off the borders in several different ways.
The 'Base' role is setting the border color of everything to transparent.
The Base-->Header-->GridHeader role is setting 'Border Style' to None (on the Properties tab)
And finally, the Base-->ControlArea-->GridControlAreaBase-->GridControlArea role is setting the Border Alpha to Transparent.
So you have to correct all three of these in order to get borders to show up.
I still can't get it to display the borders in my sample. In the AppStylist for the .isl file, I changed the UI Role>Base -- Properties>Border Style to Solid, Common States>Border to Black, Other States>Edit & Read Only Border to Black; same for Grid Cell and Grid Row. Still no borders anywhere. What do I need to change? Thanks. Ron
Sorry for the delay. I never got a notification that you posted your sample.
Anyway, I ran it now, and it looks like I was correct. Your isl is explicitly turning off the borders for these objects and making them transparent, so the DrawFilter is skipping this phase. This is a little odd, but I think it does this in cases where the particular phase doesn't draw at all. As far as the grid is concerned, the headers and cells have no border and so no space is being left for the borders or being accounted for when positioning other objects. For example, when the header draws it's text, it's normally inside the borders, so if there are no borders and then you draw some, your borders will end up too close to the text because no padding was created.
If you want to handle the border drawing in your drawfilter, then you can't turn off the borders completely in the isl file.
In fact, your isl is actually turning off the borders on everything by setting the Border color to Transparent on the 'Base' role. This is not a good idea. It's generally bad practice to set any properties on the Base role, because this can have unintended consequences (such as the one you are currently experiencing) since it affects every object at every level. The only exception to this is the Themed Element Alpha, which is useful for turning off themes aplication-wide.
Just checking to see if my returned sample executes.
Thanks,