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

Expanded > icon dissapearing/appearing

12 Answers 113 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 18 Oct 2012, 01:13 PM
Hi, I have some ghosting problem with the TreeListView. Whenever I expand a row most (not all) rows become un-expandable, this can be fixed if I have many rows and can scroll down/up the treelistview.  What can be triggering this behavior I'm running Q2 2012 Sp2.

Please can you help me with this.

Cheers
kristján

12 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Oct 2012, 01:18 PM
Hi,

May I ask you to test with our latest version - Q3 2012 and let me know if you can still reproduce the problem?

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 18 Oct 2012, 02:17 PM
Hi again and thanks for the quick response.
I just updated to the newest version and I am still having the same problem.
This is my grid definition
<telerik:RadTreeListView x:Name="grid" Grid.Row="2" AutoGenerateColumns="False" RowLoaded="grid_RowLoaded" IsFilteringAllowed="False" telerik:StyleManager.Theme="Windows7"
                                RowIsExpandedChanging="grid_RowIsExpandedChanging" SelectionChanged="grid_SelectionChanged" BeginningEdit="grid_BeginningEdit" CellEditEnded="grid_CellEditEnded"
                                ContextMenu="{StaticResource RadTreeListViewItemContext}" SelectionMode="Single" EnableRowVirtualization="True" EnableColumnVirtualization="False">
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding IsChecked, Mode=TwoWay}" IsReadOnly="False" >
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Checked="OnChecked" Unchecked="OnUnchecked" IsThreeState="False" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadTreeListView.Columns>
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>

Can you please advice further.
Cheers
kristján
 


0
Vlad
Telerik team
answered on 19 Oct 2012, 06:28 AM
Hello,

 This may happen if you are setting IsExpandable in RowLoaded. Please use Styles and StyleSelectors instead similar to our demos. The tree list expand/collapse now will not destroy/recreate all rows like in the previous versions however will reuse rows and RowLoaded will not be raised for reused rows. 

If you still you want to use the previous behavior your can simply set AlternationCount (for example to 2) and in this case all rows will be destroyed/recreated during expand/collapse.

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 22 Oct 2012, 10:27 AM
Hi again Vlad.
"This may happen if you are setting IsExpandable in RowLoaded. Please use Styles and StyleSelectors instead similar to our demos."
I am setting the IsExpandable in RowLoaded,.

I am not quite sure what you mean. I've been digging in your demo and the only demo I see with anything you are suggesting is the on demand example in witch this code is presented. ps. the example is also using RowLoaded.

<telerik:RadTreeListView.RowStyleSelector>
                <telerik:ConditionalStyleSelector>
                    <telerik:StyleRule Condition="IsEmpty">
                        <Style TargetType="telerik:TreeListViewRow"
                               BasedOn="{StaticResource TreeListViewRowStyle}">
                            <Setter Property="IsExpandable"
                                    Value="False" />
                        </Style>
                    </telerik:StyleRule>
                    <telerik:StyleRule Condition="Not IsEmpty">
                        <Style TargetType="telerik:TreeListViewRow"
                               BasedOn="{StaticResource TreeListViewRowStyle}">
                            <Setter Property="IsExpandable"
                                    Value="True" />
                        </Style>
                    </telerik:StyleRule>
                </telerik:ConditionalStyleSelector>
            </telerik:RadTreeListView.RowStyleSelector>

And I get a error on StaticResource TreeListViewRowStyle...
I there any way you can provide an example since I'm not quite sure on how to implement this ?

Best regards
Kristján

0
Vlad
Telerik team
answered on 22 Oct 2012, 10:35 AM
Hi,

This example is using style selectors not RowLoaded. Do you have the same problem on our demo?

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 22 Oct 2012, 10:57 AM
Hi,
No, don't have the same problem in the demo, only in my code. this is the inner exception  ->
"Cannot find resource named 'TreeListViewRowStyle'. Resource names are case sensitive"

In the demo, I cannot see the TreeListViewRowStyle being declared, am I missing something, is there an help topic about this (did not find any in you help)

Thanks again
Kristján
0
Vlad
Telerik team
answered on 22 Oct 2012, 10:58 AM
Hello,

 You can check this article for more info:
http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 22 Oct 2012, 11:40 AM
Thanks for the link, but it does not solve my problem, I was meaning help on the Expand by demand on the TreeListGridView.  I am following the no demand demo example. do I need to reference anything that the demo is not showing me ?

Best regards
Kristján



0
Vlad
Telerik team
answered on 22 Oct 2012, 11:52 AM
Hi,

 The article says that if you are using our implicit themes (like our own demos) you can reference our styles directly by using simple rule - class name + "Style".

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 22 Oct 2012, 01:02 PM
HI,
Ok fair, but I am not able to resolve the style via

<telerik:RadTreeListView.RowStyleSelector>
                <telerik:ConditionalStyleSelector>
                    <telerik:StyleRule Condition="IsEmpty">
                        <Style TargetType="telerik:TreeListViewRow" BasedOn="{StaticResource TreeListViewRowStyle}">
                            <Setter Property="IsExpandable" Value="False" />
                        </Style>
                    </telerik:StyleRule>
                    <telerik:StyleRule Condition="Not IsEmpty">
                        <Style TargetType="telerik:TreeListViewRow" BasedOn="{StaticResource TreeListViewRowStyle}">
                            <Setter Property="IsExpandable"  Value="True" />
                        </Style>
                    </telerik:StyleRule>
                </telerik:ConditionalStyleSelector>
            </telerik:RadTreeListView.RowStyleSelector>

The styles are not resolved and I am following your example.
Is TreeListViewRowStyle created somewhere and do I need to reference it somewhere from my point of view this is not clear (using the demo app)?

I've attached  the error from my Visual studio, but the solution builds anyway, but crashes as soon as the control that I am working on is opened.

Best regards
Kristján
0
Accepted
Vlad
Telerik team
answered on 22 Oct 2012, 01:07 PM
Hi,

Are you using implicit themes like we do in our demos? Please check the help article I've sent you once again!

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 22 Oct 2012, 01:27 PM
the what now :P
We do not have one those, feel a bit stupid for not recognizing that earlier, one should not work when being sick. I tried the second method, works fine.

Thanks for your help and patient.
Tags
TreeListView
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or