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

[Solved] Event on Row Delete?

8 Answers 182 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alfa
Top achievements
Rank 1
Alfa asked on 25 Nov 2009, 10:00 AM
Hi,

Is there any event fires when Row Is deleted?

I was using 

private void Grid_KeyUp(object sender, KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Delete)
{
//..pre-delete code
//remove item from ObservableCollection
//post-delete code
}

But this removes two items from Grid, if CanUserDeleteRows is set to true.

Rgds
Alfa


8 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 30 Nov 2009, 06:40 PM
Hi Alfa,

We have already implemented Deleting/Deleted pair of events as per your request. The events will be available this Friday with our latest internal build.

Thank you for your valuable feedback. I have updated your Telerik points.


Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alfa
Top achievements
Rank 1
answered on 07 Dec 2009, 06:01 AM
Hi,

Is the new build, with these events, available?
I can see only 1127 built.

Rgds
Alfa.
0
brandon
Top achievements
Rank 1
answered on 08 Dec 2009, 05:03 PM
I also am waiting for this delete event.  Is the internal build delayed?
0
Milan
Telerik team
answered on 09 Dec 2009, 04:28 PM
Hello Brandon,

 

Sorry for the delayed internal build but we have just release SP1 of Q3 2009. If you could upgrade to this release you will be able to utilize the Deleted/Deleting events.

Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
brandon
Top achievements
Rank 1
answered on 11 Dec 2009, 12:17 AM
I see the 2 new events (Deleting, Deleted).  From my tests though, it doesn't seem that the row is deleted until after the Deleted event is fired, not before like it is supposed to.
0
Milan
Telerik team
answered on 11 Dec 2009, 01:59 PM
Hello Brandon,

 

Thins is highly unlikely. Could you please double check this or send us a sample application where this behavior can be observed.


Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
brandon
Top achievements
Rank 1
answered on 11 Dec 2009, 11:27 PM
Maybe that is not the exact issue.   But when bound to a DomainDataSource, the row doesn't get automatically deleted from the database, while the add's and edit's do work.  I have to manually delete them by doing something like this:
private void TestGridDeleted(object sender, GridViewDeletedEventArgs e) 
    var context = (TestDomainContext)TestDataSource.DomainContext; 
  
    foreach (TestEntity testEntity in e.Items) 
    { 
        context.TestEntities.Remove(TestEntity); 
    }
    TestDataSource.SubmitChanges(); 


Can you post a quick sample where deleting does work with a DomainDataSource? 
0
Milan
Telerik team
answered on 15 Dec 2009, 12:54 PM
Hello brandon,

 

Currently this scenario is not supported out of the box - for the time being you can use the workaround where the deleted items are manually removed from the domain context. We have logged this issue and we will start working on a fix as soon as possible.

I have updated your Telerik points. Thank you for your feedback.

All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Alfa
Top achievements
Rank 1
Answers by
Milan
Telerik team
Alfa
Top achievements
Rank 1
brandon
Top achievements
Rank 1
Share this question
or