Silverlight TabControl - Finding and selecting a TabItem from a given Control in the TabItem.

Posted by David Gray Wright on Stack Overflow See other posts from Stack Overflow or by David Gray Wright
Published on 2010-05-03T00:47:58Z Indexed on 2010/05/03 0:58 UTC
Read the original article Hit count: 485

Filed under:
|
|

I am building a LOB application that has a main section and a TabControl with various TabItems in it. On hitting save the idea is that any fields in error are highlighted and the first field in error gets the focus.

If the first, and only, field in error is on an Unselected tab the tab should then become selected and the field in error should become highlighted and have focus. But I can not get this to work.

What appears to be happening is that the Unselected tab is not in the visual tree so you can't navigate back to the owning TabItem and make it the currently selected TabItem in the TabControl.

Has anyone got an idea on how this can be done\achieved?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about tabcontrol