Having this style defined in app.xaml...
.. breaks the TreeListView expand/collapse behaviour. This breaks regardless of the value of the Background. This was an extremely time consuming and frustrating bug to track down.
Full sample:
MainWindow.xaml
App.xaml
Codebehind:
Cheers,
Andy
<
Style
TargetType
=
"Grid"
>
<
Setter
Property
=
"Background"
Value
=
"#00000000"
/>
</
Style
>
.. breaks the TreeListView expand/collapse behaviour. This breaks regardless of the value of the Background. This was an extremely time consuming and frustrating bug to track down.
Full sample:
MainWindow.xaml
<
Window
x:Class
=
"TreeListViewExample.MainWindow"
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Controls:RadTreeListView
ItemsSource
=
"{Binding Items}"
AutoGenerateColumns
=
"False"
>
<
Controls:RadTreeListView.ChildTableDefinitions
>
<
Controls:TreeListViewTableDefinition
ItemsSource
=
"{Binding Children}"
/>
</
Controls:RadTreeListView.ChildTableDefinitions
>
<
Controls:RadTreeListView.Columns
>
<
Controls:GridViewDataColumn
Header
=
"Test"
DataMemberBinding
=
"{Binding Text}"
/>
</
Controls:RadTreeListView.Columns
>
</
Controls:RadTreeListView
>
</
Grid
>
</
Window
>
App.xaml
<
Application
x:Class
=
"TreeListViewExample.App"
StartupUri
=
"MainWindow.xaml"
>
<
Application.Resources
>
<
Style
TargetType
=
"Grid"
>
<
Setter
Property
=
"Background"
Value
=
"Green"
/>
</
Style
>
</
Application.Resources
>
</
Application
>
Codebehind:
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
DataContext =
this
;
Items =
new
ObservableCollection<TestClass>();
var child3 =
new
TestClass {Text =
"child 3"
};
var child2 =
new
TestClass {Text =
"child 2"
, Children =
new
[] {child3}};
var child =
new
TestClass {Text =
"child"
, Children =
new
[] {child2}};
Items.Add(child);
}
public
ObservableCollection<TestClass> Items {
get
;
private
set
; }
}
public
class
TestClass
{
public
string
Text {
get
;
set
; }
public
IEnumerable<TestClass> Children {
get
;
set
; }
}
Cheers,
Andy