Hi guys,
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?
Best,
Alex
You could also add the cell to the Buttons tag property.
Hi Frank,
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.
Best,
Alex
Hi Alex,
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.
Best regards
Frank
Please login first to submit.