c# - DataGridView backcolor of the first row is white although the selection backcolor is transparent -
i hide selection option of datagridview
seems nothing has been selected.
i have set selectionbackcolor
property of datagridview
transparent
. when loads, first row's color white although turns transparent
select other rows. @ beginning white.
this how looks after loading:
and how looks click on row:
how can make looks second picture?
just deselect first row after you've filled grid. default first row selected when fill it, possible have no rows @ selected.
datatable dtb = new datatable("d"); dtb.columns.add("c1"); dtb.rows.add("a"); dtb.rows.add("b"); dtb.rows.add("c"); dtb.rows.add("d"); dtb.rows.add("e"); datagridview1.datasource = dtb; datagridview1.selectionmode = datagridviewselectionmode.fullrowselect; if (datagridview1.selectedrows.count > 0) { datagridview1.rows[0].selected = false; }
Comments
Post a Comment