This is a migrated thread and some comments may be shown as answers.

Style When Focus Lost

3 Answers 201 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
heavywoody
Top achievements
Rank 1
heavywoody asked on 15 Oct 2010, 04:37 AM
I am using the Office2k7Black Theme on the Treeview.  It looks great, until it loses focus to another control.  Then the user cannot read what is selected because it is completely white.  I don't really want to restyle the whole thing, so it there something I can do to keep the selected look?  I have attached two pictures.  One shows the item selected, the next once I click on the item on the right and the treeview loses focus.

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 20 Oct 2010, 12:17 PM
Hello Christian,

Please find attached an example.

If you have further questions please do not hesitate to ask us.
I hope this will help you.


Best wishes,
Dimitrina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
heavywoody
Top achievements
Rank 1
answered on 02 Jan 2011, 08:46 PM
Sorry, took me a long time to respond.   How would I apply this style if I am using a TemplateSelector to a bound TreeView?  This is how my TreeView is bound:

<telerik:RadTreeView Grid.Row="1" x:Name="WorkflowItems" MinWidth="200" Margin="8" Controls:StyleManager.Theme="Transparent"
                                ItemTemplateSelector="{StaticResource selTemplate}"
                                 SelectionChanged="treeWorkflow_SelectionChanged"
                   PreviewSelected="treeWorkflow_PreviewSelected" IsLoadOnDemandEnabled="True" IsExpandOnSingleClickEnabled="False" SelectionMode="Single" LoadOnDemand="treeWorkflow_LoadOnDemand" />

Any my datatemplates:

        <DataTemplate x:Key="ShmoogTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/DocumentIcon.png" Margin="0 0 3 0"></Image>
                <TextBlock Foreground="White" Text="{Binding DisplayName}" />
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key="WorkFlowTemplateItemTemplate">
            <StackPanel Orientation="Horizontal">
                <Image Source="/Images/DropboxIcon.png" Margin="0 0 3 0"></Image>
                <TextBlock Foreground="White" Text="{Binding DisplayName}" />
            </StackPanel>
        </DataTemplate>

0
Petar Mladenov
Telerik team
answered on 04 Jan 2011, 04:04 PM
Hello Christian Loepp,

You just need to remove the key of the style and it will apply to all the newly created RadTreeViewItems. You can find this approach in the attached solution. Feel free to ask if you need further assistance.

Kind regards,
Petar Mladenov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
TreeView
Asked by
heavywoody
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
heavywoody
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or