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
175
XamDataGrid Cell Styles changes in version 10.2
posted

It seems that you've change the way XamDataGrid styles its fields in the new version (v10.2).

In version 9.2 it was possible to set a style to CellValuePresenter that will be affected on all of the fields,

for example: it was possible to change the HorizontalContentAligment of the CellValuePresenter style and it would be applied to all of the fields automatically.

Most of you examples in the forum proposes exactly that solution for scenarios like that, although from some reason you've changed it in v10.2 and it doesn't work anymore.

You claim that your controls are backward compatible although it took me about 4 hours now to adapt my code to your latest changes.

Anyway, as I said, your current solution for changing those kind of properties is by setting the default style of the editor of the column. All I found is an example of changing the style of XamTextEditor (which works fine) but what if I want all of my columns to be aligned to left? is there any way to set the default alignment of all the cells in a grid without creating a default style for every possible editor?

  • 175
    posted

    Any comments?

  • 138253
    Offline posted

    Hello,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you use the following Style for the CellValuePresenter in order to make all the content of all Cells centered:

     

    <Style TargetType="{x:Type igDP:CellValuePresenter}">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>
    

     

    Feel free to write me if you have further questions.