1 Answer, 1 is accepted
0
Accepted
Hi Alan,
You can attach to these three events and raise / clear a flag:
And the XAML:
I have attached the sample project that the above code snippet is from.
Please, let me know if you have any other questions or trouble with the sample project.
All the best,
Ross
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.
You can attach to these three events and raise / clear a flag:
| using System.Windows.Controls; |
| using Telerik.Windows.Controls; |
| using Telerik.Windows.Data; |
| namespace Ticket226810 |
| { |
| public partial class Page : UserControl |
| { |
| bool isGridEditing = false; |
| public Page() |
| { |
| InitializeComponent(); |
| this.playersGrid.ItemsSource = Club.GetPlayers(); |
| this.playersGrid.BeginningEdit += new System.EventHandler<GridViewBeginningEditRoutedEventArgs>(playersGrid_BeginningEdit); |
| this.playersGrid.RowEditEnded += new System.EventHandler<GridViewRowEditEndedEventArgs>(playersGrid_RowEditEnded); |
| this.playersGrid.CellEditEnded += new System.EventHandler<GridViewCellEditEndedEventArgs>(playersGrid_CellEditEnded); |
| } |
| void playersGrid_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e) |
| { |
| this.isGridEditing = true; |
| this.isEditingTextBlock.Text = "EDITING..."; |
| } |
| void playersGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e) |
| { |
| this.isGridEditing = false; |
| this.isEditingTextBlock.Text = "NOT EDITING..."; |
| } |
| void playersGrid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e) |
| { |
| this.isGridEditing = false; |
| this.isEditingTextBlock.Text = "NOT EDITING..."; |
| } |
| } |
| } |
And the XAML:
| <UserControl x:Class="Ticket226810.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:local="clr-namespace:Ticket226810;assembly=Ticket226810"> |
| <Grid> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="Auto"/> |
| <RowDefinition Height="Auto"/> |
| </Grid.RowDefinitions> |
| <TextBlock Name="isEditingTextBlock" |
| Margin="10" |
| Text="Here you will see whether the grid is editing or not..."/> |
| <local:MyGrid Name="playersGrid" |
| Grid.Row="1" |
| AutoGenerateColumns="False" |
| ColumnsWidthMode="Auto"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"> |
| </telerik:GridViewDataColumn> |
| <telerik:GridViewDataColumn Header="Number" DataMemberBinding="{Binding Number}"> |
| </telerik:GridViewDataColumn> |
| <telerik:GridViewDataColumn Header="Position" DataMemberBinding="{Binding Position}"> |
| </telerik:GridViewDataColumn> |
| <telerik:GridViewDataColumn Header="Country" DataMemberBinding="{Binding Country}"> |
| </telerik:GridViewDataColumn> |
| </telerik:RadGridView.Columns> |
| </local:MyGrid> |
| </Grid> |
| </UserControl> |
I have attached the sample project that the above code snippet is from.
Please, let me know if you have any other questions or trouble with the sample project.
All the best,
Ross
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.