Hi all togehter,
i use the TreeViewAdv Control in my WPF Application.
<ScrollViewer Grid.Row="1">
<syncfusion:TreeViewAdv x:Name="Tree"
ItemsSource="{Binding ProjectsView}"
SelectedTreeItem="{Binding SelectedProject,Mode=TwoWay}"
AllowMultiSelect="False"
SelectionChanged="Tree_SelectionChanged"
>
<syncfusion:TreeViewAdv.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding SubProjects}" >
<ContentControl Content="{Binding}"
ContentTemplate="{StaticResource ProjectsSelectionTemplate}" />
</HierarchicalDataTemplate>
</syncfusion:TreeViewAdv.ItemTemplate
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
Command="{Binding EntitySelectedCommand,diag:PresentationTraceSources.TraceLevel=High}" >
</i:InvokeCommandAction>
</i:EventTrigger>
</i:Interaction.Triggers>
</syncfusion:TreeViewAdv>
</ScrollViewer>
Part of ViewModel wher PrpjectsView i typeop ICollectionView
ProjectDto _selectedProject;
public ProjectDto SelectedProject {
get {return _selectedProject;}
set {
SetProperty(ref _selectedProject,value);
System.Threading.Thread.Sleep(500);
if (SelectedProject != null) {
Console.WriteLine("Selected {0}",SelectedProject.ProjectName);
ProjectsView.MoveCurrentTo(SelectedProject);
}
}
}
When i scroll down the Tree an click an Item, the SelectedTreeItem changes, but, the Tree always jump to the first position.
This works only with he line 'Thread.Sleep(500). If i comment out this line, the tree scrolls only to the first position, so there is no selection.
Any ideas?
Thanks
Peter
Hi,
me again.
is nobody outside who can help me.
This is a very serious problem i i never see this behavior bevore.
Thanks
Peter
<syncfusion:TreeViewAdv x:Name="TreeView"RequestBringIntoView="TreeView_RequestBringIntoView"
ItemsSource="{Binding Customers}" SelectedTreeItem="{BindingSelectedTreeItem,Mode=TwoWay}"> |
private void TreeView_RequestBringIntoView(object sender, RequestBringIntoViewEventArgse)
{
e.Handled = true;
} |
Works perfectly
Thanks a lot
Peter