Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1467
TextVAlign
posted

In the InitializeLayout event of a grid, I set the e.Layout.Bands[bandName].Columns[columnName].Width of each column, and I set

            e.Layout.Override.RowSizing = RowSizing.AutoFree;
            e.Layout.Override.CellMultiLine = DefaultableBoolean.True;

The text automatically wraps if it is not wide enough to fit in a column, and the row height adjusts automatically. However the text in all cells is aligned to the top of the cell. I think the grid would look a lot better if all text were centered vertically instead.

I have tried setting

            e.Layout.Override.CellAppearance.TextVAlign = VAlign.Middle;

and several variants of this, but I have been unable to find a way to make the text in all cells center vertically, although the text in some of them, for example in the Date columns, does do so. There must be a way, but what is it?

 

Parents Reply Children