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

TreeView's FocusColor&SelectedColor after command binding

3 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
F1Soft
Top achievements
Rank 1
F1Soft asked on 10 May 2018, 04:59 PM

Hi.

I have a problem.

TreeView works good. but after binding command, FocusColor & SelectedColor changed(See Attached image).

XAML like this:

--------------------------------------------------------------------------------------------

        <telerik:RadTreeView ItemsSource="{Binding BookChapterTrees}">

           <!-- Start: If remove this part, it works well -->
            <telerik:RadTreeView.ItemContainerStyle>
                <Style TargetType="telerik:RadTreeViewItem">
                    <Setter Property="Command" Value="{Binding TreeSelectCommand}" />
                    <Setter Property="CommandParameter" Value="{Binding}" />
                </Style>
            </telerik:RadTreeView.ItemContainerStyle> 

            <!-- End: If remove this part, it works well -->

            <telerik:RadTreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding TreeChildren}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="88"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding TreeChapter.ChapterName}" 
                                   FontFamily="Segoe UI" FontWeight="Bold" TextDecorations="Underline"/>
                        <StackPanel Orientation="Horizontal" Grid.Column="2">
                            <TextBlock Text=" .  .  . "  FontFamily="Segoe UI" />
                            <TextBlock Text="{Binding TreeChapter.StartLocalPage}"  FontFamily="Segoe UI" />
                            <TextBlock Text="  ( "  FontFamily="Segoe UI" />
                            <TextBlock Text="{Binding TreeChapter.StartPage}"  FontFamily="Segoe UI" />
                            <TextBlock Text=" )"  FontFamily="Segoe UI" />
                        </StackPanel>
                    </Grid>
                </HierarchicalDataTemplate>
            </telerik:RadTreeView.ItemTemplate>
        </telerik:RadTreeView>

--------------------------------------------------------------------------------------------

Bounded command [TreeSelectCommand] is doing nothing.

Do you know, Why color changed?

3 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 14 May 2018, 10:54 AM
Hi Jae Yong Kum,

Thank you for the provided pictures.

In the attached images I can see that you are using our Green theme. Correct me if I am wrong. I tried to reproduce this behavior using the provided code snippet but to no avail. Attached to this reply is the sample project which I created to test your scenario. Can you take a look at this project and let me know what I need to change to reproduce this behavior on my side.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
F1Soft
Top achievements
Rank 1
answered on 14 May 2018, 11:08 AM

Hi Dinko.

Your project works good.

I had change that did not use Command & CommandParameter Binding with use SelectedItem Binging.

It works good(same works) and did not affect to themes.(Because my application use changing themes ^^)

Thank you for reply.

0
Dinko | Tech Support Engineer
Telerik team
answered on 17 May 2018, 09:08 AM
Hi Jae Yong Kum,

From your last reply, I am assuming that the provided project works on your side and you manage to found a solution for your scenario. Correct me If I am wrong. If further questions arise you can open a new thread with your questions inside and we will be happy to help.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TreeView
Asked by
F1Soft
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
F1Soft
Top achievements
Rank 1
Share this question
or