datagridView.RowsDefaultCellStyle.SelectionForeColor = Color.NavydatagridView.RowsDefaultCellStyle.SelectionBackColor = Color.WhiteSmokedatagridView.RowsDefaultCellStyle.SelectionFont(?) is not exist..
How to make bold font of a selected row?
Try this
Font _fnt = new Font("Arial",12,FontStyle.Bold);
dataGridView1.RowsDefaultCellStyle.Font = _fnt;
Ahhh no wait...that can't be right.
That will change for all the cells.
Let me put that on a form and see what it does.
Okay this is not going to be the best way of doing it but it does work.
Font _DefaultFont = new Font("Arial", 10, FontStyle.Regular); private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { Int32 _SelectedRowIndex = dataGridView1.CurrentRow.Index; Font _fnt = new Font("Arial", 12, FontStyle.Bold); DataGridViewRow _selectedRow = dataGridView1.SelectedRows[0]; _selectedRow.DefaultCellStyle.Font = _fnt; for (Int16 _i = 0; _i < dataGridView1.Rows.Count; _i++) { if (_i != Convert.ToInt16(_SelectedRowIndex)) { DataGridViewRow _Row = dataGridView1.Rows[_i]; _Row.DefaultCellStyle.Font = _DefaultFont; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)