Hi,
How can I right-align data in Pivot-cells?
I don't see any functionality to do this. We have the ability to set the CellFormat for all data rows with PivotGrid.CellFormatting. Likewise it would be useful to have CellHorizontalContentAlignment.
Thanks
Sangeetha
Hi Sangeetha
Create a Style like this:
<Style x:Key="A_Right" TargetType="ig:PivotCellControl" > <Setter Property="Foreground" Value="Black"/> <Setter Property="Background" Value="White"/> <Setter Property="HorizontalContentAlignment" Value="Right"/></Style>
In code behind use the following event on xampivotgrid:
Private Sub XamPivotGrid_CellControlAttached(sender As Object, e As Infragistics.Controls.Grids.PivotCellControlAttachedEventArgs) Handles XamPivotGrid.CellControlAttached e.Cell.Style = TryCast(Me.Resources("A_Right"), System.Windows.Style)End Sub
You can define a lote of properties in style and rich your grid at demand. See this post: http://ko.infragistics.com/community/forums/p/81244/409842.aspx#409842
I hope that help you.
Juan Quintero.Venezuela.
Hello Sangeetha,
I am glad to hear that you have worked this out. If you need any additional assistance on the matter, I will be glad to help.
I load various themes for PivotGrid. I set the following property in PivotCellControl and it takes care of it.
<Setter Property="HorizontalContentAlignment" Value="Right"/>
Also, I noticed that I was using old themes. The SR2094 themes have pivot cell data right-aligned.