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
1100
XamDataGrid Field has wrong alignment
posted

Hello,

I recently upgraded my XamDataGrid from the express version to the release version 9.2.20092.2001. After the upgrade, my custom ExpandableFieldRecordPresenter stopped working correctly. I went ahead and upgraded its basline XAML code from the newer DefaultStyles and have begun fixing the problems. I am presently using nested panels mode (i.e. <igDP:GridViewSettings UseNestedPanels="True"/>).

Numerical field content is now unexpectedly right-aligned. How to I restore the left-alignment behavior?

Thank you.

P.S. I am using NetAdvantage for WPF 2009 Volume 2 with service release NetAdvantage_WPF_20092_SR_2001.msp.

  • 69686
    Verified Answer
    posted

    Hello,

    This is not an issue related to the ExpandableFieldRecordPresenter.

    As you have been using the express version, the XamDataGrid was using a XamTextEditor to display the values in the cells (no matter of their type - string or numeric), because only the XamTextEditor is present in the express version.

    When you have upgraded, the XamDataGrid automatically selects new editors for different data types. 

    By default, the numeric values are displayed in XamNumericEditor or XamDecimalEditor which are right-aligned. String values are left-aligned.

    If you want to change that behavior, you can set the HorizontalContentAlignment property of the value editor with a style setter,like so:

     <Style TargetType="{x:Type igEditors:XamNumericEditor}">

                            <Setter Property="HorizontalContentAlignment" Value="Left"/>

                        </Style>

    Hope this helps.