【发布时间】:2011-04-20 20:55:42
【问题描述】:
我为 DataGridView 上的 CellFormatting 事件添加了一个处理程序,以根据行的内容修改背景颜色。
即使数据被插入到表中,它似乎也没有被触发。我通过在 IDE 中双击 CellFormatting 事件来添加事件处理程序,这似乎可以正确创建代码。
private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// this never gets called
MessageBox.Show("Event fired");
}
我做错了什么?
【问题讨论】: