I have created a Data Grid View in Visual studio using c#. It has three columns. Now I want to add a new column at the end containing list data. Column with one row of size of the Data Grid View table. Grayed one in the image I have created yellow part I have to add.
You could to do not draw a Top border for that column. Something like this:
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
e.AdvancedBorderStyle.Bottom = DataGridViewAdvancedCellBorderStyle.None;
if (e.ColumnIndex == 3 && e.RowIndex > 1)
{
e.AdvancedBorderStyle.Top = DataGridViewAdvancedCellBorderStyle.None;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.