Pages

Friday, April 25, 2008

Set value to unbound column

To set value in unbound column cells you have to handle CellFormating event. Then, check DataGridViewCellFormattingEventArgs and set value. For example:

private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 2)
{
e.Value = "Test";
}
}

No comments:

Post a Comment