How can i know tapped textblock's Grid.ColumnProperty?? RRS feed

  • Question

  • I create 100 textblocks in a 10X10 Grid dynamiclly,and the textblocks use only one Click() .How can i know tapped  textblock's Grid.ColumnProperty in Click() ??

    I want to know which grid's textblock was tapped.


    Tuesday, March 11, 2014 3:12 PM

All replies

  • That is to say,which Grid was clicked?I need to know the row and col.

    I use below code in click(),but it not works.

    (object sender, System.Windows.Input.GestureEventArgs e)



              int ii=(int)tempVar.GetValue(Grid.ColumnProperty);  
              int jj = (int)tempVar.GetValue(Grid.RowProperty);



    Tuesday, March 11, 2014 3:17 PM