Hi!
I have a XamDataGrid and I want to display the content of the rows not on the left or right but center. I tried the
but still the content is on the left (if it is a text) or on the right (if it is a number) of the cell. But I want to have all values of all cells centered.
I can set the LabelTextAlignment of each row to Center, but then still there's only the lable centered but not the value..
When I used CellValuePresenter style the column line's separator disappear and the cell contents not set at right side if the cell.
Here's my code
<UserControl.Resources> <Style TargetType="{x:Type igDP:CellValuePresenter }"> <Setter Property="HorizontalContentAlignment" Value="Right"/> <Setter Property="HorizontalAlignment" Value="Right"/> </Style> </UserControl.Resources>
Thanks
We are happy that we were able to help you.
Thanks for the feedback and the kind words!
We are glad we are able help you.
I found wpf-winform interop to be frustrating, and I missed by project deadline. I decided to start over & write the thing using wpf instead and I got more work done in two days than I did in the week before!
Project is completed and looks/works awesome now. I found most of the answers to my questions by searching the forums. Thanks Alex, Mital, Peter Manov, Aaron Marsi
Hello
@apettit7:
If your type is CellValuePresenter, then in the setter it also should be CellValuePresenter.HorizontalContentAlignmentProperty. In this manner, you should apply the style to a CellValuePresenter, not to XamDataGrid. You can get an instance of a CellValuePresenter with the methods of its static class.
CellValuePresenter.FromCell();
CellValuePresenter.FromRecordAndField();
and then apply the style.
Alex.