title: Can I apply operation to a range of cell indexes in GridView's RowDataBound Event?
body: <p>I am setting GridView's layout features in the RowDataBound event based on the content of specific cells</p>
  
  <pre><code>private void OnRowDataBound(Object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          if (e.Row.Cells[1].Text == "&amp;nbsp;")
          {
              e.Row.Cells[4].BackColor = System.Drawing.Color.White;
              e.Row.Cells[5].BackColor = System.Drawing.Color.White;
              e.Row.Cells[6].BackColor = System.Drawing.Color.White;
  </code></pre>
  
  <p>Is there a way to specify the range (cell index 4 to 6) where this operation has to be applied to?</p>
  
  <p>Something like:</p>
  
  <pre><code>private void OnRowDataBound(Object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          if (e.Row.Cells[1].Text == "&amp;nbsp;" &amp;&amp; e.Row.CellIndex &gt;= 4 &amp;&amp; e.Row.CellIndex &lt;= 6)
          {
              e.Row.BackColor = System.Drawing.Color.White;
  </code></pre>