Hi,
I use Setters in c# to set various formatting in pivotGrid cells.
p.e.
// CellStyle.BorderBrush
_Setter = new Setter();
_Setter.Property = BorderBrushProperty;
_Setter.Value = ControlProperties["CellStyle.BorderBrush"].Data;
pivotGrid.CellStyle.Setters.Add(_Setter);
hi
This method does not change the value. below is a picture from debbuger and value is not changed.
Could you tell me how you query the value?
Todor
This does change it but it changes the actual data not just the format.so next time when I query the cell, it returns the formatted data which is not what a want. Is there an elegant way of dealing with it.
Hi
You can set new display format as is shown in snippet below
private void Button_Click(object sender, RoutedEventArgs e) { object value = pivotGrid.DataSource.Result.Cells[0, 0].Value; pivotGrid.DataSource.Result.Cells[0, 0].SetValue(value, null, "{0:billion 00}"); pivotGrid.ArrangeLayout(); }
the cells array is the array with underlaying data.
RegardsTodor
Once the data is bound. Is there a way to change the format without refreshing the grid..?
The property we added to the control is CellFormatString. It can be used like snippet below:
pivotGrid.CellFormatString = "##{0}";
The property takes effect if not other formating strings are applyed to the measures.