I initially created the project with a regualr datagrid. When the user clicks on a hyperlink button from the datagrid 2 commands are fired. One for setting the view model's selecteditem and then the command to load the correct details based on which button was clicked and which selecteditem is set. This does not work with the radgridview. If you just click on the hyperlinkbutton is only calls the command for the button and does not fire the selecteditem command at all which is bound to the selectionChanged event of the radgrid.
I have a couple of questions here about the gridview. How can I use the gridview and get both parameters sent to the viewmodel so I can load the correct data?
Here's what I currently have... if there's another way to do this please let me know.
[code]
<telerik:RadGridView AutoGenerateColumns="False"
ItemsSource="{Binding DiscAggregates}"
SelectedItem="{Binding SelectedSchool,Mode=TwoWay}" Margin="0,75,0,0" Name="rgvDiscipline" SelectionMode="Single" SelectionUnit="FullRow">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand
Command="{Binding SelectionChangedCommand}"
CommandParameter="{Binding SelectedItem, ElementName=dgDisc}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding InSchool}" Header="In School" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton
Content="{Binding InSchool}"
Command="{Binding Source={StaticResource Locator},Path=Discipline.SchoolDetailsCommand}"
CommandParameter="InSchool"
NavigateUri="/Views/details.xaml"
HorizontalAlignment="Left" Name="HyperlinkButton1" VerticalAlignment="Top" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
[/code]
I have a couple of questions here about the gridview. How can I use the gridview and get both parameters sent to the viewmodel so I can load the correct data?
Here's what I currently have... if there's another way to do this please let me know.
[code]
<telerik:RadGridView AutoGenerateColumns="False"
ItemsSource="{Binding DiscAggregates}"
SelectedItem="{Binding SelectedSchool,Mode=TwoWay}" Margin="0,75,0,0" Name="rgvDiscipline" SelectionMode="Single" SelectionUnit="FullRow">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand
Command="{Binding SelectionChangedCommand}"
CommandParameter="{Binding SelectedItem, ElementName=dgDisc}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn DataMemberBinding="{Binding InSchool}" Header="In School" IsReadOnly="True">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton
Content="{Binding InSchool}"
Command="{Binding Source={StaticResource Locator},Path=Discipline.SchoolDetailsCommand}"
CommandParameter="InSchool"
NavigateUri="/Views/details.xaml"
HorizontalAlignment="Left" Name="HyperlinkButton1" VerticalAlignment="Top" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
[/code]