<telerik:RadGridView x:Name="grid" ItemsSource="{Binding Path(ns:class.property)}"
SelectionMode="Single"
ShowGroupPanel="False" AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False"
RowIndicatorVisibility="Collapsed" Controls:StyleManager.Theme="Office_Black" EnableColumnVirtualization="False" EnableRowVirtualization="False" IsFilteringAllowed="False" Controls:RadControl.Theme="Office_Black" ReorderColumnsMode="None"
/>
now when i try to change selected item from code like this:
grid.SelectedItem = Collection[0];
the grid.SelectedItem stays null
even though Collection[0] is not null
i tried to call OnApplyTemplate before assignment but it didn't helped
i tried to do it with two way data binding and it didn't helped too
what can cause this?
and how can i solve it?
thanks

<Window x:Class="TreeViewTest.MainWindow" Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Icon="/TreeViewTest;component/ics.ico"> <Grid> <telerik:RadTreeView HorizontalAlignment="Left" Name="treeView1" VerticalAlignment="Top" IsLineEnabled="True" FontFamily="Arial" FontSize="10" ImagesBaseDir="/Icons/" IsDragPreviewEnabled="False"> <telerik:RadTreeViewItem Header="Global" DefaultImageSrc="Folder_16x16-32.png"> <telerik:RadTreeViewItem Header="Local 1" /> <telerik:RadTreeViewItem Header="Local 2" /> </telerik:RadTreeViewItem> </telerik:RadTreeView> </Grid></Window><Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.Resources><HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding SubNodes}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Name}"/> </StackPanel> </HierarchicalDataTemplate> </Grid.Resources><telerik:RadTreeView Name="uxRadTreeView" ItemsSource="{Binding RootFolder.SubNodes}" ItemTemplate="{StaticResource NodeTemplate}" AllowDrop="False" IsDragDropEnabled="True" DragEnded="uxRadTreeView_DragEnded" MouseRightButtonUp="uxRadTreeView_MouseRightButtonUp"> <telerik:RadContextMenu.ContextMenu> <telerik:RadContextMenu IsEnabled="{Binding MainTree.CurrentItem.IsFolder, Mode=OneWay}" > <telerik:RadMenuItem Header="Create new folder" Icon="/GuiResources;component/ActionsIcons/newFolder.png" Click="NewFolder" /> <telerik:RadMenuItem Header="Create new file" Icon="/GuiResources;component/ActionsIcons/newFile.png" Click="NewFile"/> <telerik:RadMenuItem Header="Add a new version of this file" Icon="/GuiResources;component/ActionsIcons/newFileVersion.png" Click="NewFileVersion"/> <telerik:RadMenuItem Header="Delete" Icon="/GuiResources;component/ActionsIcons/delete.png" Click="Delete"/> </telerik:RadContextMenu> </telerik:RadContextMenu.ContextMenu> </telerik:RadTreeView> </Grid>