0

I want to detect the row/column index of a Grid control when Mouse click a certain slot on that Grid. How to do it?

I am development a Win8 Store application with C#/XAML.

Thanks!

Peter Hansen
  • 8,807
  • 1
  • 36
  • 44
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
  • This has been answered before [Duplicate][1] [1]: http://stackoverflow.com/questions/2143849/ways-to-identify-which-cell-was-clicked-on-wpf-grid – Rohit Sharma Nov 21 '12 at 03:25

2 Answers2

0

you should look into PointerPoint class

PointerPoint pt = e.GetCurrentPoint(gridView);
currentContactPt = pt.Position;
Mayank
  • 8,777
  • 4
  • 35
  • 60
0

Declare an array and initialize it's elements with the rows/columns of grid. Then you can check in a loop which element's mouse click is triggered.

nj-ath
  • 3,028
  • 2
  • 25
  • 41