or


| <telerik:GridViewColumn Header="Delete" IsVisible="True"> |
| <telerik:GridViewColumn.CellTemplate> |
| <DataTemplate> |
| <Button Width="18" Height="18" Margin="5,0" |
| Command="ApplicationCommands.Delete" CommandParameter="{Binding}" > |
| <Button.Content> |
| <Grid Width="8.083" Height="8.664" VerticalAlignment="Center" HorizontalAlignment="Center"> |
| <Path Fill="{x:Null}" Stretch="Fill" Stroke="#FF000000" Margin="0.083,0.664,0,0" Data="M0.50001547,0.5 L6.5000797,6.5000169 M6.5000155,0.5 L0.5,6.5000704" StrokeThickness="2"/> |
| <Path Fill="#FFCE3527" Stretch="Fill" Stroke="#FFCD3527" Margin="0,0,0.083,0.664" Data="M0.50001547,0.5 L6.5000797,6.5000169 M6.5000155,0.5 L0.5,6.5000704" StrokeThickness="2"/> |
| </Grid> |
| </Button.Content> |
| </Button> |
| </DataTemplate> |
| </telerik:GridViewColumn.CellTemplate> |
| </telerik:GridViewColumn> |
| public ucChartRegionGrid2() |
| { |
| InitializeComponent(); |
| this.Loaded += new RoutedEventHandler( ucChartRegionGrid2_Loaded ); |
| this.CommandBindings.Add( new CommandBinding( ApplicationCommands.Delete, |
| this.DeleteExecuted, this.DeleteCanExecute ) ); |
| radGridViewDataBinding.SelectionChanged += new |
| EventHandler<Telerik.Windows.Controls.SelectionChangeEventArgs>(radGridViewDataBinding_SelectionChanged); |
| } |
| public void DeleteCanExecute(object sender, CanExecuteRoutedEventArgs e) |
| { |
| e.CanExecute = true; |
| } |
| public void DeleteExecuted(object sender, ExecutedRoutedEventArgs e) |
| { |
| // set a breakpoint here. It’s not hit, but the row disappears from the grid!? |
| RegionEvent2 deleteRange = e.Parameter as RegionEvent2; |
private void textFilter_PreviewKeyDown(object sender, KeyEventArgs e) { switch (e.Key) { case Key.Down: { e.Handled = true; RoutedUICommand moveDownCommand = RadGridViewCommands.MoveDown as RoutedUICommand; RoutedUICommand selectCommand = RadGridViewCommands.SelectCurrentUnit as RoutedUICommand; moveDownCommand.Execute(null, this.radGridView); selectCommand.Execute(null, this.radGridView); break; } case Key.Up: { e.Handled = true; RoutedUICommand moveUpCommand = RadGridViewCommands.MoveUp as RoutedUICommand; RoutedUICommand selectCommand = RadGridViewCommands.SelectCurrentUnit as RoutedUICommand; moveUpCommand.Execute(null, this.radGridView); selectCommand.Execute(null, this.radGridView); break; } default: return; } textFilter.Focus();
}