David Smith

David Smith

  • NA
  • 2k
  • 0

C# Painting cells, rows , columns at runtime

Feb 22 2010 10:32 AM

Hi i want to be able to   Paint cells, rows , and columns at runtime.  


right now I have a sample code but its only painting to row 1 row. I want to be able to paint to all.
this is what i have so far.  Is there away I can just pick the color from the colordialog box at run time and display to the grid instead
of me assigning the color by code.


            if (checkBox1.Checked)
            {
                dataGridView2.Rows[1].DefaultCellStyle.BackColor = Color.White;
            }
            else
            {
                dataGridView2.Rows[1].DefaultCellStyle.BackColor = Color.Red;
            }

Answers (13)