DataGridView,如何对以字符串开头的单元格使用 if 语句
DataGridView, How to use if statement for a cell that starts with a string
我希望能够使用 if 语句来确定以字符串 "Manual" 开头的 DGV 单元格的颜色。我知道如何更改单元格的颜色
if (Convert.ToString(DGV_Points.Rows[x].Cells[2].Value.StartsWith) == "Manual")
{
}
也可以在单击 header 时禁用单元格默认颜色的恢复吗?
if (DGV_Points.Rows[x].Cells[2].Value.ToString().StartsWith("Manual"))
{
}
这是您要找的吗?
我希望能够使用 if 语句来确定以字符串 "Manual" 开头的 DGV 单元格的颜色。我知道如何更改单元格的颜色
if (Convert.ToString(DGV_Points.Rows[x].Cells[2].Value.StartsWith) == "Manual")
{
}
也可以在单击 header 时禁用单元格默认颜色的恢复吗?
if (DGV_Points.Rows[x].Cells[2].Value.ToString().StartsWith("Manual"))
{
}
这是您要找的吗?