dgv.CellValidating - ColumnIndex showing wrong?

  • Thread starter Thread starter Sergio_CL
  • Start date Start date
S

Sergio_CL

Guest
Hi,

Sure this is something I'm just missing. Have a couple datagridview controls (each one inside its own groupbox) on a form.

On the .CellValidating event, I just have msgbox(e.columnindex). First time I click a cell (say, third cell), MsgBox shows 0, than I click on the fifth column and I get 3, then on the first cell and I get 5.

First two columns are readonly (whole dgv is not readonly), not bound to data.

What should I look for to make sure e.columnindex returns the cell index I just clicked? Trying to validate cell changes and this way it's just impossible :( Sure it's not a bug, just something I couldn't find in Google...

Thanks!
ST

VS 16.6.3 / Win 10 / .Net Framework 4.7.2

Continue reading...
 
Back
Top