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
1095
Cell style properties - HorizontalContentAlignmentProperty
posted

In a XamWebGrid on Cell level (CellControlAttached event) im trying to change a cells style "in codebehind".

doing :

------------

Syle s = new Style(typeof(CellControl));

s.Setters.Add(

 

new Setter(CellControl.FontWeightProperty, FontWeights.Bold));

e.Cell.Style = s;

--------------

- works fine.

Question : How come doing :

s.Setters.Add(

new Setter(CellControl.HorizontalContentAlignmentProperty, HorizontalAlignment.Right));

-before applying the style, does not work ?

Parents
No Data
Reply
  • 40030
    Offline posted

    Hi,

    The HorizontalContentAlignment and VerticalContentAlignment properties are actually dictated by the Column. So, no matter what you set the property to be on an individual cell, it will go back to what the column dictates.

    Column.HorizontalContentAlignment, Column.VerticalContentAlignment.

    -SteveZ

Children