日期:2014-05-19  浏览次数:21051 次

如何自定义GridView在编辑时候的样式?(
如何自定义GridView在编辑时候的样式?(

------解决方案--------------------
DataGridViewCellStyle style = new DataGridViewCellStyle();
//设置一些你想实现的样式

private void dataGridView1_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)
{
dataGridView1.Rows[e.RowIndex].DefaultCellStyle = style;
}

private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{
//恢复以前的样式
}