Guys, I'm trying to add an event to a datagridview cell content click for when a user clicks a cell row it changes a value on that row.
Example my datagridview on colunm [2] has the word "start" i want the user to click the cell and the word changes to "stop" on colunm [2] is that possible?

1 answers
Something like this should work:
answered one year ago by:
17279
690
Hi vulpes - i tried the above it but it doesn't seem to change the value? would i some how need to include that the start/stop value is in: row.Cells[2]
17279
Not unless you want to restrict this exercise to a particular column in which case you can simply return if e.ColumnIndex != 2 and use 2 for the column index in the rest of the code. I tried the code myself before posting it and it worked fine.Notice though that the contents of a cell need to have been committed (i.e. you need to have moved off the cell after entering 'start') before it will work. Also, if there's any possibility that 'start' could be preceded or followed by whitespace, I'd use content.ToLower().Trim() == "start".
690
Ah, yes that's working now, i used your edited idea as yes i wanted to focus it only on one column, it works great now though - thanks again vulpes.