Hello,
I want to display "N/A" in the pivot grid when the values are -1
my datasource is flatdatasource
is is possible?
Thanks,
Hi,
When try to sort a column that has NA value in it,
it fires an exception that cannot compare it to double, so how can i resolve it? or at least to capture the sorting event of the column header.
nharake
Thanks it worked.
But I still have the conditional formatting issue
Hi
You are right. the content shoud be updated too. so change the code to be like this:
void pivotGrid_CellControlAttached(object sender, Infragistics.Controls.Grids.PivotCellControlAttachedEventArgs e) { if (e.Cell.Data is ICell) { ICell cell = e.Cell.Data as ICell; if (cell.Value != null) { int val; if (int.TryParse(cell.Value.ToString(), out val) && val == 30) { cell.SetValue("NA", null, null); e.Cell.Control.Content = "NA"; } } } pivotGrid.DataColumns[0].ColumnWidth = 200; }
Thanks alot
but there is something very weird going on,
when i load the page, it gives me the -1 values not the NA
but when i scroll down the grid, then i scroll up, i found the -1 turned to be NA
and the down half values are still -1,
means the hidden part is NA
why is that?
You can this by using CellControlAttached event of pivot grid. Below is a snippet:
pivotGrid.CellControlAttached += new EventHandler<Infragistics.Controls.Grids.PivotCellControlAttachedEventArgs>(pivotGrid_CellControlAttached);
void pivotGrid_CellControlAttached(object sender, Infragistics.Controls.Grids.PivotCellControlAttachedEventArgs e){ if (e.Cell.Data is ICell) { ICell cell = e.Cell.Data as ICell; if(cell.Value !=null) { int val; if (int.TryParse(cell.Value.ToString(), out val) && val == -1) { cell.SetValue("NA", null, null); } } }}