title: How to access the "real" object behind cells in DataRow
body: <p>I wanna associate a custom object to each cell in a <code>DataTable</code>'s <code>DataRow</code> so that, on the events I get from the DataGridView, I can customize coloring and other behavior. So, when I add a new row, I do the following:</p>
  
  <pre><code>  DataRow oRow = dtItens.NewRow();
    oRow["CodFamilia"] = new ClsCelula(TipoCelula.tcMostrar, "", Color.White);
    oRow["Familia"] = new ClsCelula(TipoCelula.tcMostrar, "", Color.White);
    oRow["Item"] = new ClsCelula(TipoCelula.tcMostrar, "", Color.White);
    oRow["Descricao"] = new ClsCelula(TipoCelula.tcMostrar, "", Color.White);
    oRow["Referencia"] = new ClsCelula(TipoCelula.tcMostrar, "Saldo Inicial", Color.Aqua);
    dtItens.Rows.Add(oRow);
  </code></pre>
  
  <p>On the DataGridView's CellFormatting event, I want to get my ClsCelula object to read it's properties, like below:</p>
  
  <pre><code>Object oCelula = dtItens.Rows[e.RowIndex][e.ColumnIndex];
  if (oCelula != null)
  {
    if (oCelula is ClsCelula)
    {
      ClsCelula oValorCelula = (ClsCelula)oCelula;
      e.CellStyle.BackColor = oValorCelula.Cor;
    }
  }
  </code></pre>
  
  <p>However, this doesn't work, since probably the code is calling <code>ToString()</code> when I read the Row/Column index, so oCelula is always a <code>System.String</code>. Is there any way around this? How can I access the "real" object?</p>