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
625
Cannot Center Cell Content
posted

I have a custom control that contains a XamDataGrid (v10.3).  AutoGenerateColumns = false and fields are dynamically and added to a FieldLayout that is then assigned as the DefaultFieldLayout.  All fields bind to numeric properties of business objects.  I have tried the following to center the content in my grid's cells:

From code:

            foreach (Field fld in myControl.myXamDataGrid.DefaultFieldLayout.Fields)
            {
                fld.Settings.CellValuePresenterStyle = new Style(typeof(CellValuePresenter));
 
                fld.Settings.CellValuePresenterStyle.Setters.Add(new Setter(CellValuePresenter.HorizontalContentAlignmentPropertyHorizontalAlignment.Center));
 
            }
From XAML (UserControl.Resources):
        <Style TargetType="{x:Type igDP:CellValuePresenter}">
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Center" />
        </Style>

None of these approaches are working. Any ideas?
Thanks,
Paul
Parents
No Data
Reply
  • 138253
    Offline posted

    Hello Paul,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

Children
No Data