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

Command call from RowDetailsTemplate

1 Answer 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 09 Jan 2013, 10:13 PM
We have a RadGridView and within this grid we have another RadGridView. We are trying to get the selected item from this nested sub-grid. The code below just shows a button (we have ripped out the other grid) we are unable to get this button to call the command in our viewModel. We have tried buttons, the grid enabled select checkboxes. Nothing will call our command property. 

<telerik:RadGridView.RowDetailsTemplate>
                        <DataTemplate>
                            <Button Command="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=DataContext.SelectCommand}" CommandParameter="{Binding}" Content="Button" Margin="4"></Button>
                        </DataTemplate>
                    </telerik:RadGridView.RowDetailsTemplate>
                </telerik:RadGridView>

we have also tried - where Root is the name of our UserControl.

<Button Command="{Binding ElementName=Root, Path=DataContext.SelectCommand}" CommandParameter="{Binding}" Content="Button" Margin="4"></Button>

We have read online that there may be a limitation of this control doing what we would like it to do - can someone please give some clarity on how we can best solve this situation.

thank you.

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 14 Jan 2013, 10:21 AM
Hello George,

 
In order to achieve your goal, I can suggest you to check this forum thread. In the forum you can find a sample project, showing you how to bind a command from your ViewModel to a button in RadGridView.

I hope this helps.


Regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
George
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or