datagridview通过cellformatting给一个未绑定的列赋值后无法将值取回
private void dgElementList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if(e.ColumnIndex==0){
e.Value = e.RowIndex % 10;
e.FormattingApplied = true;
}
}
这样赋值之后能够显示出0 - 9的数字, 但是以后使用dgElementList.Rows[x].Cells[0].Value 取到的值为null。请问这是为啥?