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:

enter image description here

and how looks click on row:

enter image description here

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

Popular posts from this blog

java - Unable to make sub reports with Jasper -

Save and close a word document by giving a name in R -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -