I have a DGV related context menu bar. When a cell is clicked in the DGV, it will open the context menu bar, and I can click "plotStripMenuItem" to open the form (formPlot), which basically reads the data from the text file and the graphs of the graphs and calculates some statistics that will (after as formPlot is closed) to the previously pressed DGV line.
to do this, I use "int clickedRow" to save the number of the clicked line before opening formPlot, and use this to update the DGV after I closed formPlot.
private void plotToolStripMenuItem_Click(object sender, EventArgs e) {
In most cases, this works as expected. But I noticed that sometimes it does not update the DGV cells that were clicked before I opened formPlot. Instead, he updated line number 0!
eg. I hit row 7, but after returning from formPlot, the value of DGV row 0 was updated. Not the value of the string DGV number 7.
Now it seems to me that line 0 will be updated as I clicked line 7 and saved it in a variable.
Am I missing something?
source share