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

confirmation prompt when editing cell

1 Answer 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
jake
Top achievements
Rank 1
jake asked on 25 Oct 2010, 08:27 PM
I need to show a Confirm prompt one a user is finished editing a cell.

Here is my current CellEditEnded eventhandler:
private void gvAccounts_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
{
    if (e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Cancel)
        return;
 
    oldNickname = e.OldData.ToString();
    newNickname = e.NewData.ToString();
 
    // nothing has changed
    if (oldNickname == newNickname)
        return;
 
    RadWindow.Confirm("Are you sure you want to change this nickname to " + newNickname + "?", this.ChangeNickname);
}

oldNickname and newNickname are global variables so I can keep up with the new/old values.

however, when any button on the prompt is clicked (or anywhere on the screen is clicked) another CellEditEnded event is fired but e.OldData is the same as e.NewData which overwrites my global variables.

I don't understand why the second event is firing.

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Oct 2010, 07:28 AM
Hi jake,

I tried to reproduce the issue you described, but unfortunately I was not able to. I am sending you the sample project I used for testing it. Please take a look at it and share if there is some misunderstandings according to your requirements.
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
jake
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or