dataGridView1.RowTemplate.DividerHeight = 5;How can double underline cell in DataGridView similar to this image?I want to show total in last row, and total's cell in DataGridView should be in underlined or some border at bottom of cell 解决方案 You can handle CellPainting event of DataGridView and draw a double border at bottom of the specified row this way:void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e){ if (e.RowIndex == 1 && e.ColumnIndex >= 0) { e.Paint(e.CellBounds, e.PaintParts); e.Graphics.DrawLine(Pens.Black, e.CellBounds.Left, e.CellBounds.Bottom - 2, e.CellBounds.Right, e.CellBounds.Bottom - 2); e.Graphics.DrawLine(Pens.Black, e.CellBounds.Left, e.CellBounds.Bottom - 4, e.CellBounds.Right, e.CellBounds.Bottom - 4); e.Handled = true; }}Also as another option you can set DividerHeight of the the specified row to a larger value:dataGridView1.Rows[1].DividerHeight = 5; In case if you want to set divider height for all rows, before adding rows or before setting data source, set the DividerHeight for RowTemplate, for example:dataGridView1.RowTemplate.DividerHeight = 5; 这篇关于DataGridView 双下划线单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-25 03:03