Hi,
I want to bind selected rows from our viewmodel.
To do it in RadTreeView I added ContainerBindings to HierarchicalDataTemplate that binds IsSelected property of RadTreeViewItem.
How can I achieve this in RadGridView? I failed to find a way to add ContainerBindings to GridViewRow.
Thanks,
Alexey Zakharov.
I want to bind selected rows from our viewmodel.
To do it in RadTreeView I added ContainerBindings to HierarchicalDataTemplate that binds IsSelected property of RadTreeViewItem.
How can I achieve this in RadGridView? I failed to find a way to add ContainerBindings to GridViewRow.
Thanks,
Alexey Zakharov.
3 Answers, 1 is accepted
0
Hello Alexey,
The most common scenario is to bind the IsSelected property of our GridViewRow to the selection property of your View model classes. Unfortunately such binding is not possible prior Q2. If you try our latest relase you will be able to create container bindings.
I am sending you a sample project that demonstrates how you can bind the IsSelected property of GridViewRow in code.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The most common scenario is to bind the IsSelected property of our GridViewRow to the selection property of your View model classes. Unfortunately such binding is not possible prior Q2. If you try our latest relase you will be able to create container bindings.
I am sending you a sample project that demonstrates how you can bind the IsSelected property of GridViewRow in code.
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alexey
Top achievements
Rank 2
answered on 15 Jul 2009, 06:27 AM
Hi Milan,
But can I achieve this without codebehind?
PS : We are using Q2 last build for Silverlight 3.
Thanks,
Alexey Zakharov.
But can I achieve this without codebehind?
PS : We are using Q2 last build for Silverlight 3.
Thanks,
Alexey Zakharov.
0
Hi Alexey,
Such bindings are a not as straightforward to implement in SL as oposed to WPF but with a little bit of work you can bind the IsSelected property in XAML. I have modified the original sample application and you can now create bindings like this:
You just have to create a new style for GridViewRow and set one attachable property. After that just apply the new style using the RowStyle property of RadGridView.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Such bindings are a not as straightforward to implement in SL as oposed to WPF but with a little bit of work you can bind the IsSelected property in XAML. I have modified the original sample application and you can now create bindings like this:
<Grid x:Name="LayoutRoot" Background="White"> |
<Grid.Resources> |
<Style x:Key="CustomRowStyle" TargetType="grid:GridViewRow"> |
<Setter Property="local:IsSelectedBinding.PropertyName" Value="Selected"/> |
</Style> |
</Grid.Resources> |
<telerikGrid:RadGridView Name="RadGridView1" RowStyle="{StaticResource CustomRowStyle}"> |
</telerikGrid:RadGridView> |
</Grid> |
You just have to create a new style for GridViewRow and set one attachable property. After that just apply the new style using the RowStyle property of RadGridView.
All the best,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.