0
我想在DataGridView中格式化指定的行,但它不斷格式化我的DataGridView中的所有行。這是我在做什麼:DataGridView CellFormatting在指定的行和單元格
private void dgwParti_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
foreach (DeParti tmp in bnsParti)
{
if (tmp.Arti.Type == ArtiType.Fast)
{
if (e.ColumnIndex == 0 || e.ColumnIndex == 3 ||
e.ColumnIndex == 8 || e.ColumnIndex == 9)
{
e.Value = "";
}
}
}
}
使用這種類型的代碼,它不斷設置單元格的值「」,在所有的行,但我只想要那個值是「」,當ARTI類型是快速。有任何想法嗎。
在此先感謝。
什麼是'bnsParti'? – Otiel
@Otiel BindingSource – Brezhnews