Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是关于 C# 语言的。
我想将 a 中的最后一列DataGridView用作颜色列。列表中的 Row 将包含一些数据,并且该行的最后一列单元格将具有颜色来表示它是对还是错,好还是坏。(类似的东西)是否可以这样做以及如何(如果可能)?
DataGridView
设置数据源后,您可以使用-
foreach (DataGridViewRow row in yourDataGridView.Rows) { if (row.Cells[LastColumnIndex].Value == YourValue) { row.Cells[LastColumnIndex].Style.BackColor = Color.Red; } }
希望,你有这个想法。