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

RadGrid1_ItemDeleted is not what i want

2 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 2
Darren asked on 14 Jan 2009, 08:08 AM
Morning,

I want to make a record of a record that is going to be deleted just before it's deleted.
I tried using the RadGrid1_ItemDeleted event but the record is deleted by the time the event fires.
Which event can i use so when i click delete, i can exec my stored proc which will copy the record but then it will be deleted?


Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 14 Jan 2009, 08:38 AM
Hi Darren,

It is possible to access the record in Item_Command event before going to delete. In the Item_Command event check for the CommandName whether it is "Delete", if yes get the row before deleting and call the stored procedure. Check the example below.

CS:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    if (e.CommandName == "Delete"
    { 
        GridDataItem item = (GridDataItem) e.Item; // item which is going to delete 
    } 

Thanks,
Shinu


0
Darren
Top achievements
Rank 2
answered on 14 Jan 2009, 09:50 AM
Thanks man u helped me.
Tags
Grid
Asked by
Darren
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Darren
Top achievements
Rank 2
Share this question
or