You can't really find a point for a DGV cell because cells occupy a rectangular area in a DGV. However, you can find this area by using the DataGridView.GetCellDisplayRectangle() method. It returns a Rectangle
for the display area of a DGV Cell given by the Cell's column and row indices. If you really want a point you can easily use the Rectangle
to construct Points for any of the Rectangle
's four corners.
// Get Rectangle for second column in second row.
var cellRectangle = dataGridView1.GetCellDisplayRectangle(1, 1, true);
// Can create Points using the Rectangle if you want.
Console.WriteLine("Top Left x:{0} y:{1}", cellRectangle.Left, cellRectangle.Top);
Console.WriteLine("Bottom Right x:{0} y:{1}", cellRectangle.Right, cellRectangle.Bottom);
But I agree with your question's commenters; it would be better to create a custom DataGridViewColumn and host your TextBox and Button there. Here's an example of doing this for the DateTimePicker control:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…