Hi!
I am new in C#.
I am using a datagrid. Is it possible to find out in which cell I have clicked. And is it possible to highlight it? Or change the content of the cell.
Does anybody know a good tutorial for C# ?
Thanks for help !!!
Printable View
Hi!
I am new in C#.
I am using a datagrid. Is it possible to find out in which cell I have clicked. And is it possible to highlight it? Or change the content of the cell.
Does anybody know a good tutorial for C# ?
Thanks for help !!!
Yes you will have to use HitTest method.Quote:
Originally posted by AngryT
Hi!
I am new in C#.
I am using a datagrid. Is it possible to find out in which cell I have clicked. And is it possible to highlight it? Or change the content of the cell.
Does anybody know a good tutorial for C# ?
Thanks for help !!!
As for Tutorial check this, http://www.c-sharpcorner.com/Tutorials.aspCode:
Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dgContact.HitTest(pt);
MessageBox.Show (hti.Column.ToString() + " " + hti.Row.ToString());