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
3550
Align numeric columns to right
posted

I noticed that   the text in the cells of numeric coulmns is aligned to left.

I want it to align to right

by default.

I think this is the way it should be.

Is it possible?

  • 152
    posted

    You can also set this property directly in the grid designer if you know your column is a numeric one.

    YourGrid.DisplayLayout.Bands[0].Columns[index].CellAppearance.TextHAlign = Right

  • 1803
    posted

    Hi,

    Sure you can do that,

    first identify the particular column ,ie

    1.loop thru col and find datatype of the column to be int or

    2.in Initialize event specify the col ----->.DisplayLayout.Bands(0).Columns("SUM").CellAppearance.TextHAlign = HAlign.Right