title: How to change the backcolor of a listview subitem using its own value
body: <p>How can I programmatically change the back color of a single cell in a listview using its own value?</p>
  
  <p><img src="https://i.stack.imgur.com/JCDcn.jpg" alt="alt text"></p>
  
  <p>The values in the ColorFlag Column Came from the database.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>foreach(DataRow dr in _dataTbl.Rows) 
          {
              _markOW = dr["Mark"].ToString();
              _stock = dr["Stock"].ToString();
              _SteelSectio = dr["SteelSection"].ToString();
              _colo = (Int32)dr["Color"];
  
  
              ListViewItem _lvi = new ListViewItem(_markOW);
              _lvi.SubItems.AddRange(new string[]{_SteelSectio, _stock,     _colo.ToString()});
  
              _myListView.Items.Add(_lvi);   }
  </code></pre>
  
  <p>Here is the code that I have tried to change the backcolor of the cells:</p>
  
  <pre><code>for (int _i = 0; _i &lt; _owLV.Items.Count; _i++)
              {
                  _myListView.Items[_i].UseItemStyleForSubItems = false;
                  _myListView.Items[_i].SubItems[3].BackColor = Color.FromArgb(_colo);
              }
  </code></pre>
  
  <p>Thanks in advance</p>