I have a WPF Grid which is divided into 3 rows and 3 columns, i wasn\'t able to find a way of getting the row and column number of mouse click on the net, ohh and if it is p
It's answered here: Ways to identify which cell was clicked on WPF Grid?
I've never used WPF Grid before, though using that link above as an example I think something like this should do it:
Add this to your Initialize method:
this.GridCtrl.MouseDown += new MouseButtonEventHandler(GridCtrl_MouseDown);
And add new method to handle the event:
private void GridCtrl_MouseDown(object sender, MouseButtonEventArgs e)
{
if (sender != null)
{
Grid _grid = sender as Grid;
int _row = (int)_grid.GetValue(Grid.RowProperty);
int _column = (int)_grid.GetValue(Grid.ColumnProperty);
MessageBox.Show(string.Format("Grid clicked at column {0}, row {1}", _column, _row));
}
}