c# - When is Datagridview's Paint and Cellpainting called? -


i have datagridview dgv, let's 3 of columns want affect manually :

col1 : datagridviewtextboxcolumn, displaying number  col2 : datagridviewtextboxcolumn, used color indicator, without text. backcolor will changed later.  col3 : datagridviewimagecolumn 

other columns binded respective datapropertyname of underlying datasource. 3 columns above not binded datapropertyname , affected manually, example when want change image or color indicator.

every time affect datasource, datasource rebind , dgv.invalidate() update grid's graphic.

  1. when , how ask dgv take account manual values in 3 edited columns ? manually affect 3 above column inside dgv_cellpainting. work cellpainting takes long time , decide remove it. tried putting them inside dgv_paint (which used merging headers) not take color nor image.

with cellpainting : rectangles spaces between rows, filling background, separater between rows, boxes image , color, etc. 3 columns refering first column (index), color , image (in boxes) columns. other image constant.

enter image description here

without cellpainting: no row , column separation. created pseudo row separation setting grid's cell border horizontal.

enter image description here

  1. when cellpainting , paint called? execution order , difference? rough understanding called when cell/grid "need repainted". notice called multiple times, not when call invalidate() when hover mouse on grid region.

thanks all.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -