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

Databinding and CurrentItem

1 Answer 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
madladuk
Top achievements
Rank 2
madladuk asked on 22 Oct 2010, 02:41 PM
Hi. I have a treeview bound to my ria domain collection, however when I select an item in the try the current record is not changed. Is the treeview not dataaware? or have I missed something?
<telerik:RadTreeView x:Name="radTreeView1"
                             Margin="0,5,5,5"
                             IsLineEnabled="True"
                             SelectionMode="Single"
                             IsEditable="False"
                             IsDragDropEnabled="False"
                             ItemsSource="{Binding}"
                             ItemTemplate="{StaticResource Persons}"


Thanks
Paul

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 27 Oct 2010, 04:04 PM
Hi madladuk,

 You can bind the IsSelected property of the RadTreeViewItems  to property of an item in the RIA collection ( you have to use ContainerBindings --> http://www.telerik.com/help/silverlight/radtreeview-how-to-bind-hierarchical-data-use-containerbindingcollection.html ).

Supposing that you  use a DomainDataSource to bind your RadTreeView, a key moment is handling the RadTreeView.SelectionChanged event like so:

private void myTreeView_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e)
        {
            MyDataSource.SubmitChanges();
        }

Hope this info helps you. Please feel free to let us know if you need further assistance.

Greetings,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TreeView
Asked by
madladuk
Top achievements
Rank 2
Answers by
Petar Mladenov
Telerik team
Share this question
or