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
990
N/A values on pivotGrid
posted

Hello,

 I want to display "N/A" in the pivot grid when the values are -1

my datasource is flatdatasource

is is possible?

 

Thanks,

Parents
No Data
Reply
  • 7922
    posted

    Hi

    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"nullnull);
                }
            }
        }
    }

Children