Function acting funny
Can someone please help me figure out why my function to copy the contents of the cell only works when I click on the far right collumn of a datagridview?
10 Replies
What is
localClipboard
in this code?
And the code specifically gets the first cell in a row btw. I'm not sure if that's intended or notSorry, localClipboard is a datatable defined earlier in the code, I did this so that I can keep track of what has been copied to the clipboard so that the user can access recent symbols copied to the clipboard
It is not, which line are you talking about?
row.Cells[0].Value.ToString()
so yeah, it uses the correct row, but it always uses the first columnUmm
Small issue
It's not the first column that is the one that copies
It's the last column
¯\_(ツ)_/¯
The column listed CharacterName
Yeh, the first column definitely doesn't work.
set some breakpoints, see what happens as it goes
$debug if you don't know what that is
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
From the breakpoints, it doesn't even register that the cell is being clicked if it is not in the far right column
Although, when I click on the cell labelled "Unicode Characters", and only that cell in that column, it registers
I have figured out the issue
When using CellContentClick, it only registers if the contents of the cell have been clicked, not the entire cell
For anyone else with the same problem, try using CellClick instead
Thanks Pobiega for the help