Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit How to get a control's (i.e. textblock) position in a grid
4 replies. Latest Post by pratham78 on March 26, 2009.
(0)
pratham78
Member
3 points
31 Posts
03-26-2009 7:09 AM |
I have textblocks created dynamically and positioned in a grid. I added addhandlers to handle events for the textblock. Is there a way to find out on which row and column my textblock positioned on the grid?
nandkish...
71 points
49 Posts
03-26-2009 7:43 AM |
Hi,
cau u try for this.
use temp for getting position .
duefectu
Participant
788 points
241 Posts
03-26-2009 8:19 AM |
On your click event you can put something like this:
int grid=Grid.GetColumn((FrameworkElement)sender); int column = Grid.GetRow((FrameworkElement)sender);
03-26-2009 11:43 AM |
I tried your solution on a different problem I had and that worked out to be great...
Thanks
03-26-2009 3:24 PM |
pratham78: I tried your solution on a different problem I had and that worked out to be great... Thanks
Sorry that message was for NandKishore