C
C#8mo ago
Spore355

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?
No description
10 Replies
Pobiega
Pobiega8mo ago
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 not
Spore355
Spore355OP8mo ago
Sorry, 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?
Pobiega
Pobiega8mo ago
row.Cells[0].Value.ToString() so yeah, it uses the correct row, but it always uses the first column
Spore355
Spore355OP8mo ago
Umm Small issue It's not the first column that is the one that copies It's the last column
Pobiega
Pobiega8mo ago
¯\_(ツ)_/¯
Spore355
Spore355OP8mo ago
The column listed CharacterName
No description
Spore355
Spore355OP8mo ago
Yeh, the first column definitely doesn't work.
Pobiega
Pobiega8mo ago
set some breakpoints, see what happens as it goes $debug if you don't know what that is
MODiX
MODiX8mo ago
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.
Spore355
Spore355OP8mo ago
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
Want results from more Discord servers?
Add your server