title: How to set some text to datagridview cell when its cell contains 0 value in c#?
body: <p>I have a datagridview and its data from sql database.</p>
  
  <p>My datagridview some cells filled with 0(zero) value.<br>
  I want to set a NULL text at where the 0 value is filled in the datagridview.</p>
  
  <p><img src="https://i.stack.imgur.com/VZfMs.png" alt="enter image description here"></p>
  
  <pre><code>//I'm using this code but not working
   private void dataGridView4_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
      {
          for (int i = 0; i &lt; dataGridView4.Rows.Count; i++)
          {
              for (int j = 7; j &lt; dataGridView4.Rows[i].Cells.Count; j++)
              {
                  if (Convert.ToInt32(dataGridView4.Rows[i].Cells[j].Value) == 0)
                  {
                      dataGridView4.Rows[i].Cells[j].Value = "Null";
                  }
  
              }
          }
  
      }
  </code></pre>
  
  <p>My SQL Query is  :</p>
  
  <p><code>select l.admission_number,l.student_class ,l.student_name,hindi,maths,social,l.telugu,l.english ,
  '' as english_1,'' as english_2,l.science, '' as ns,'' as ps  from lkg_to_seventh_marks as l union all select e.admission_number ,e.student_class ,
  e.student_name ,hindi,maths,social,e.telugu,'' as english,e.english_1 ,e.english_2,'' as science,e.ns,e.ps from eighth_to_ninth_marks as e</code></p>