This question is locked. New answers and comments are not allowed.
Hi,
I have a RadTreeView with some items that have the following edit DataTemplate... (loaded from an ItemEditTemplateSelector if that matters). I have omitted some portions of the data template for brevity.
The "FocusHelper" control has only one purpose... When loaded, it will attempt to set focus and select all the text in it's TargetElement (in this case, the TextBox).
My problem is, that it only seems to happen the first time I go into edit mode on a tree element. As if it remembers the datatemplate the second time and doesn't fire any loaded events. As soon as I edit the element a second time, it doesn not fire any constructors or "loaded" events on the FocusHelper, and hence, doesn't focus the TextBox automatically...
Is there some way to dispose the DataTemplate or get it out of memory so that the next time it's loaded I can set the focus properly? Normally I use this FocusHelper control inside other controls with vsm's and bind the property to a state and it works perfectly...
I have a RadTreeView with some items that have the following edit DataTemplate... (loaded from an ItemEditTemplateSelector if that matters). I have omitted some portions of the data template for brevity.
<
DataTemplate
x:Key
=
"dt_TagTreeEditorMode_EditTemplate"
>
<
Grid
>
<
TextBox
x:Name
=
"tb"
Text
=
"{Binding Name, Mode=TwoWay}"
/>
<
FocusHelper:FocusHelper
TargetElement
=
"{Binding ElementName=tb}"
SetFocusOnStartup
=
"True"
/>
</
Grid
>
</
DataTemplate
>
The "FocusHelper" control has only one purpose... When loaded, it will attempt to set focus and select all the text in it's TargetElement (in this case, the TextBox).
My problem is, that it only seems to happen the first time I go into edit mode on a tree element. As if it remembers the datatemplate the second time and doesn't fire any loaded events. As soon as I edit the element a second time, it doesn not fire any constructors or "loaded" events on the FocusHelper, and hence, doesn't focus the TextBox automatically...
Is there some way to dispose the DataTemplate or get it out of memory so that the next time it's loaded I can set the focus properly? Normally I use this FocusHelper control inside other controls with vsm's and bind the property to a state and it works perfectly...