Friday, February 1, 2013

Accessing Telerik Silverlight RadGridView from Button on Group header

Accessing Telerik Silverlight RadGridView from Button on Group header

I have a RadGridView, that groups its contents. I have a Button on the group header When I click on the button (btnSave) I would like to get access to the group to read the group key.

What can I put in the Click of btnSave to accomplish this?

<telerik:RadGridView x:Name="grdNotams" Grid.Row="1" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False">     <telerik:RadGridView.Columns>         <telerik:GridViewDataColumn  UniqueName="colNewStatus" DataMemberBinding="{Binding NewStatus}" Header="New Status" IsFilterable="False" IsSortable="False">             <telerik:GridViewDataColumn.CellTemplate>                 <DataTemplate>                     <StackPanel Orientation="Horizontal">                         <telerik:RadRadioButton Content="C" Width="30" IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=C}" GroupName="{Binding RadioButtonName}"/>                         <telerik:RadRadioButton Content="M" Width="30" Margin="5,0,0,0"  IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=M}" GroupName="{Binding RadioButtonName}"/>                         <telerik:RadRadioButton Content="I" Width="30" Margin="5,0,0,0"  IsChecked="{Binding NewStatus, Mode=TwoWay, Converter={StaticResource StringToBooleanConverter},ConverterParameter=I}" GroupName="{Binding RadioButtonName}"/>                                                         </StackPanel>                 </DataTemplate>             </telerik:GridViewDataColumn.CellTemplate>         </telerik:GridViewDataColumn>         <telerik:GridViewDataColumn Header="Status" UniqueName="colStatus" DataMemberBinding="{Binding Model.Status, Converter={StaticResource StatusConverter}}" HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>         <telerik:GridViewDataColumn Header="Trip #" UniqueName="colTripNumber" DataMemberBinding="{Binding Model.TripNumber}" HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>         <telerik:GridViewDataColumn Header="Date" UniqueName="colDate" DataMemberBinding="{Binding Model.DepartureTime}" DataFormatString="d"  HeaderTextAlignment="Center" TextAlignment="Center" IsFilterable="False" IsSortable="False"/>     </telerik:RadGridView.Columns>     <telerik:RadGridView.GroupHeaderTemplate>         <DataTemplate>             <StackPanel Orientation="Horizontal">                 <telerik:RadButton x:Name="btnSave" Click="btnSave_Click">                     <StackPanel Orientation="Vertical">                         <Image Source="../images/save.jpg" Height="30" Width="30" HorizontalAlignment="Center"/>                         <TextBlock TextAlignment="Center" TextWrapping="Wrap">Update</TextBlock>                     </StackPanel>                 </telerik:RadButton>                 <TextBlock Text="{Binding Group.Key}" FontSize="14" FontWeight="Bold" FontStyle="{Binding EarliestNotamDepartureTime, Converter={StaticResource DateTimeToItalicsConverter}}" TextWrapping="Wrap" VerticalAlignment="Center" Padding="5"/>             </StackPanel>         </DataTemplate>     </telerik:RadGridView.GroupHeaderTemplate>     <telerik:RadGridView.GroupDescriptors>         <telerik:GroupDescriptor Member="NotamGroup"  >         </telerik:GroupDescriptor>         <telerik:GroupDescriptor Member="Model.NotamText">         </telerik:GroupDescriptor>     </telerik:RadGridView.GroupDescriptors> </telerik:RadGridView> 

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog