Alex Rivera | Logout

.NET DataGridView: Remove "current row" black triangle

Asked 2011-04-28T21:12:42.370
16

In the DataGridView, even if you set the grid as readonly there is a black triangle at the rows headers which is shown at the current row.

I'd like to avoid it to be shown, also I'd like to avoid the big padding of those cells caused by the triangle. I guess the padding is caused by the triangle because the cell's padding is 0.

Is it posible to do that? How?

Thanks!

Edit

This is how row headers text is created:

for (int i = 0; i < 5; i++)
{
    DataGridViewRow row = new DataGridViewRow();
    row.HeaderCell.Value = headers[i];
    dataGridView1.Rows.Add(row);
}

and headers its a simply array of strings. (string[])

Edit
Report

1 Answer

2

Triangle problem , it's simple ,put

dgv_Products.Rows[xval].Selected = true;
dgv_Products.CurrentCell  = dgv_Products.Rows[xval].Cells[0];

that is make current cell property to the cell zero of current selected row.( Tested working for dgv_Products.MultiSelect = false ; )

answered 2012-03-23T13:14:44.183

Your Answer