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

Hierarchical Grid: how to set SelectedItem

1 Answer 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 24 Sep 2012, 12:13 PM
We have a RadGridView with a Hierarchical RadGridView in a template.
We bind the selected item of the Hierarchical grid to an object in our ViewModel. (with PropertyChanged...).

When we change the object in our ViewModel, the expected row in de Hierarchical grid is not selected.

Is there a way to select an item in a Hierarchical grid from codebehind?.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 27 Sep 2012, 03:37 PM
Hello,

The reason why the SelectedItem is not updated would probably be that it cannot be resolved. You could provide a valid Source(using a StaticResource) for the Binding to the SelectedItem. For example:

<telerik:RadGridView SelectedItem="{Binding SelectedItem, Source={StaticResource MyViewModel}}"/>

Kind regards,
Didie
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
GridView
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or