Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1960
Identifying which column header was clicked in a CardView grid
posted

Hello,

I have a grid with CardView = true. As a result all the headers become labels located to the left of each card.

I want to execute some logic when the user clicks a particular header. I am handling the MouseClick event and then I get the UIElement using the ElementFromPoint method.

At runtime I noticed the the UIElement being clicked is of type TextUIElement, which makes sense because headers become labels in a CardView grid. My question is: How do I identify the grid column corresponding to that TextUIElement?

The only thing I have is the text of the TextUIElement, which corresponds to the header caption. That's not good enough since the caption can change at runtime (it's localized).

Any ideas?