This is with respect to the language C#.

I want to use the last column in a DataGridView as a color column. The Row in the list will have some data and the last column cell of that row will have a color to represent if it is right or wrong, good or bad. (something like that) Is it possible to do this and how (if possible)?

有帮助吗?

解决方案

After setting datasource, you may use-

        foreach (DataGridViewRow row in yourDataGridView.Rows)
        {
            if (row.Cells[LastColumnIndex].Value == YourValue)
            {
                row.Cells[LastColumnIndex].Style.BackColor = Color.Red;
            }
        }

Hope, you have got the idea.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top