Using the new DataGridViewCell.Control property, I added some buttons in specific cells of a datagridview in the databindingcomplete event.
Now, when one of those buttons is clicked, how can I get hold of its parent cell or row? The Parent property is null. Am I missing something?
That was fast! 🙂 Thanks!
I think the way to follow is UserData. I don’t see how to use CurrentCell in the Button_Click event. The CellClicked event does not seem to fire when I click on the button contained in the cell.
You can either use the CurrentCell.RowIndex property or store a reference in UserData.
Please take a look at the simple sample attached. It uses both techniques.
Hope that helps.
Please login first to submit.