Hi everyone.
I'm hoping somone can help me, because I've been stuck on this all evening and haven't found the answer online yet.
I have a DataGridView control and have managed to change all of the BackColors and GridColors of all of the cells, alternating row cells and selected cels. I have also sucessfully changed the BackColors of the RowHeaders and ColumnHeaders, but I can't for the life of me find out how to change the colour of the borders/gridlines of the RowHeaders and ColumnHeaders.
Here's what I have so far (just in case anyone is interested):
dataGridView1.R owsDefaultCellS tyle.SelectionB ackColor = Color.FromArgb( 98, 110, 110);
dataGridView1.R owHeadersDefaul tCellStyle.Back Color = Color.Black;
dataGridView1.R owHeadersDefaul tCellStyle.Fore Color = Color.White;
dataGridView1.C olumnHeadersDef aultCellStyle.B ackColor = Color.Black;
dataGridView1.C olumnHeadersDef aultCellStyle.F oreColor = Color.White;
dataGridView1.A lternatingRowsD efaultCellStyle .BackColor = Color.Black;
dataGridView1.G ridColor = Color.FromArgb( 80, 90, 90);
dataGridView1.R owsDefaultCellS tyle.BackColor = Color.FromArgb( 27, 30, 30);
dataGridView1.R owsDefaultCellS tyle.Padding = new Padding(5, 0, 5, 0);
dataGridView1.R owsDefaultCellS tyle.ForeColor = Color.White;
I'm hoping someone out there knows. Oh, and one other thing too... I would also like to change the colour of the selected section of the RowHeader, but haven't found a way to do that either. I'll be most grateful for any help in these areas... many thanks (hopefully) in advance.
I'm hoping somone can help me, because I've been stuck on this all evening and haven't found the answer online yet.
I have a DataGridView control and have managed to change all of the BackColors and GridColors of all of the cells, alternating row cells and selected cels. I have also sucessfully changed the BackColors of the RowHeaders and ColumnHeaders, but I can't for the life of me find out how to change the colour of the borders/gridlines of the RowHeaders and ColumnHeaders.
Here's what I have so far (just in case anyone is interested):
dataGridView1.R owsDefaultCellS tyle.SelectionB ackColor = Color.FromArgb( 98, 110, 110);
dataGridView1.R owHeadersDefaul tCellStyle.Back Color = Color.Black;
dataGridView1.R owHeadersDefaul tCellStyle.Fore Color = Color.White;
dataGridView1.C olumnHeadersDef aultCellStyle.B ackColor = Color.Black;
dataGridView1.C olumnHeadersDef aultCellStyle.F oreColor = Color.White;
dataGridView1.A lternatingRowsD efaultCellStyle .BackColor = Color.Black;
dataGridView1.G ridColor = Color.FromArgb( 80, 90, 90);
dataGridView1.R owsDefaultCellS tyle.BackColor = Color.FromArgb( 27, 30, 30);
dataGridView1.R owsDefaultCellS tyle.Padding = new Padding(5, 0, 5, 0);
dataGridView1.R owsDefaultCellS tyle.ForeColor = Color.White;
I'm hoping someone out there knows. Oh, and one other thing too... I would also like to change the colour of the selected section of the RowHeader, but haven't found a way to do that either. I'll be most grateful for any help in these areas... many thanks (hopefully) in advance.
Comment