Hi Mike,
I have applied the latest service release 9.1.20091.2039 and TextVAlign when set to "Middle" does not work and set to "Bottom" as well. This is true for all string type columns. It does work on numeric columns.
I assume this is a bug in the recent release and next service release may not be soon enough so is there a workaround you can suggest on this regard?
Your help would highly be appreciated.
Thanks,
Ronald
Thanks for your help.
The solution is a DrawFilter applied to always align the text. The filter would look something like this:
public class MiddleAlignDrawFilter : IUIElementDrawFilter { #region IUIElementDrawFilter Members
bool IUIElementDrawFilter.DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { drawParams.AppearanceData.TextVAlign = VAlign.Middle;
return false; }
DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is EditorWithTextDisplayTextUIElement) return DrawPhase.BeforeDrawForeground;
return DrawPhase.None; }
#endregion }
Then attach the filter to the Grid by setting the Grid.DrawFilter = new MiddleAlignDrawFilter();
The basic idea came from this forum post: http://community.infragistics.com/forums/t/12180.aspx.
This will allow your CellMultiLine to be True and force the rendering of the row's with TextVAlign = Middle.
So this setting (TextVAlign) is ignored for the other column types if Grid.DisplayLayout.Override.CellMultiLine = DefaultableBoolean.True;
Turn that off (Default or False) and it will be honored. I tested this back on 8.3 and it behaves the same as the current 9.1 service release.
Let me do some more nosing around...
Hi, Unfortunately I cannot open the sample application you wrote. I am using Visual Studio 2005.
I suspect that for certain scenario it does not work. I've attached a sample application so you can see it at your end.
Hi Ronald,
I wanted to know why this was not working before providing a work around and I cannot reproduce it yet. Here is the sample app I've been messing with trying to reproduce this behavior.
Run the application and click the corresponding button to modify the TextVAlign of the RowAppearance object. All the columns in the Orders table of my source are of type string.
What are you doing different in your application that I am not doing in this sample?