Evo sta pise na MSDN:
Citat:
When you handle the CellFormatting event, the ConvertEventArgs.Value property is initialized with the cell value. If you provide custom conversion from the cell value to the display value, set the ConvertEventArgs.Value property to the converted value, ensuring that the new value is of the type specified by the cell FormattedValueType property. To indicate that no further value formatting is necessary, set the DataGridViewCellFormattingEventArgs.FormattingApplied property to true.
Dakle, u prethodnom primeru e.Value je upravo vrednost polja koje se iscrtava.
Citat:
...i kako bas kad pretvoris u int dobijes da je to broj trenutnog reda
Ne dobije broj trenutnog reda kad ga pretvori u int, nego vrednost tog polja kad ga prevede u int16 tip:
Code (csharp):
int xyz = Convert.ToInt16(e.Value);
Zatim proverava da li je ta vrednost veca od 4, i ako jeste farba ceo red u kojem se nalazi to polje u roze:
Code (csharp):
if (xyz > 4 )
{
dg.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Pink;
}