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

GridViewRow.EditEndedEvent does nothing

3 Answers 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rogério
Top achievements
Rank 1
Rogério asked on 01 Apr 2009, 02:41 PM
Hello,

I'm trying to use EditEndedEvent on GridView, but the event is not fired when I finish editing any cell!

using Telerik.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using Telerik.Windows.Controls.GridView.Cells;
using Telerik.Windows.Controls.GridView.Rows;

namespace EntityTypesPrototype
{
    public partial class PropertiesFilter : UserControl
    {
        //public EntityType entityType { set; get; }        

        public PropertiesFilter()
        {
            InitializeComponent();            
            this.dgProperties.AddHandler(GridViewCell.EditEndedEvent, new EventHandler<CellRoutedEventArgs>(OnEditEnded));
            
        }
        public void OnEditEnded(object sender, CellRoutedEventArgs args)
        {
            Telerik.Windows.Controls.RadWindow.Alert("OnEditEnded");
        }

Any suggestion!?

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 02 Apr 2009, 03:32 PM
Hi Rogério,

With the Q1.2009 we introduce some "breaking" changes related to editing logic which we could not avoid.
One of these changes is that GridViewRow/Cell events are replaced by corresponding events of the GridViewDataControl object. So instead of GridViewCell.EditEndedEvent you can use GridViewDataControl.CellEditEndedEvent.

Sorry for the inconvenience caused.

Best wishes,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Rogério
Top achievements
Rank 1
answered on 02 Apr 2009, 06:22 PM
Hello,

Thanks for the reply.

Could you tell me what the EventArgs class that I should use?

I've tried with CellRoutedEventArgs but and Exception is thrown!

Thanks.

Regards,
Rogério
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 03 Apr 2009, 07:32 AM
Hello Rogério,

With the upcoming SP you would subscribe to these events by "+=". For now hooking for edit related events should look like this:

this.gridView.AddHandler(GridViewDataControl.BeginningEditEvent, new EventHandler<GridViewBeginningEditRoutedEventArgs>(GridView_BeginEdit)); 
this.gridView.AddHandler(GridViewDataControl.CellValidatingEvent, new EventHandler<GridViewCellValidatingEventArgs>(GridView_CellValidating)); 
this.gridView.AddHandler(GridViewDataControl.CellEditEndedEvent, new EventHandler<GridViewCellEditEndedEventArgs>(GridView_CellEditEnded)); 
this.gridView.AddHandler(GridViewDataControl.RowValidatingEvent, new EventHandler<GridViewRowValidatingEventArgs>(GridView_RowValidating)); 
this.gridView.AddHandler(GridViewDataControl.RowEditEndedEvent, new EventHandler<GridViewRowEditEndedEventArgs>(GridView_RowEditEnded)); 
 
private void GridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e) 
 
private void GridView_RowValidating(object sender, GridViewRowValidatingEventArgs e) 
 
private void GridView_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e) 
 
private void GridView_CellValidating(object sender, GridViewCellValidatingEventArgs e) 
 
private void GridView_BeginEdit(object sender, GridViewBeginningEditRoutedEventArgs e) 

Be aware that Row related events are fired only when RadGridView.ValidationMode == ValidationMode.Row.

Sorry again for the inconvenience.

All the best,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Rogério
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Rogério
Top achievements
Rank 1
Share this question
or