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
4160
Displaying nothing when cell value is zero
posted

Hello

How can I make the grid to display nothing when the value is zero?

Thanks a lot

Parents
  • 4555
    posted

    Hi EmoscosoCam,

    If you want to display a null value in the cell you may need to assign it a string type.  Assuming our column name is "Zero", in the Grid's Initialize_Row adding the following code snippet:

         string  i = e.Row.Cells["Zero"].Value.ToString();

                string zero = "0";

               if (string.Compare(i,zero)==0){
                   e.Row.Cells["Zero"].Value = null;

     This will display a null value in the cell.

     

     

     

     

     

     

Reply Children