Style When Focus Lost

4 posts, 0 answers
  1. heavywoody
    heavywoody avatar
    79 posts
    Member since:
    Oct 2009

    Posted 14 Oct 2010 Link to this post

    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.
  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 20 Oct 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. heavywoody
    heavywoody avatar
    79 posts
    Member since:
    Oct 2009

    Posted 02 Jan 2011 Link to this post

    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>

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 04 Jan 2011 Link to this post

    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
Back to Top