The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
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.

    Thanks.

    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