I want to have a DataGridView with one Button per row. Caption onbutton shall vary depending on other column value.
in colimn definition I wrote
UseColumnTextForButtonValue=false;
and after populating of DataTable binded to the grid I wrote such code:
CODE
foreach (DataGridViewRow rw in TaxDataGridView.Rows)
{
int cp;
cp=string.Compare(rw.Cells[0].Value.ToString(), "02");
DataGridViewButtonCell cel=(DataGridViewButtonCell)rw.Cells[6];
if (cp == 0)
{
cel.Value = "New payment";
}
else
cel.Value = " ";
}
it's strict by MSDN instruction, but doesn't work - all buttons are blank.
Did anybody solved this problem?