简体   繁体   中英

RowEditEnded event fired before save

I have a list of items in a RadGridView element. The element has a RowEditEnded eventhandler attached to it so that whenever a row in the grid is finished editing, the handler gets fired. There's a save button which is attached to another eventhandler. My problem is that the RowEditEnded handler for the last row that was edited doesn't get fired when the user makes changes to a row and clicks 'Save' button without deselecting the edited row. The RowEditEnded event gets fired for that row when the items on the list is reloaded (for refreshing the view).

Is there a way to fire the RowEditEnded handler before the save handler?

If deselecting the edited row results in a RowEditEnded event, then my proposed solution is to programmatically deselect when the save button is clicked and then proceed with your save logic.

private void HandleSaveClicked(object sender, EventArgs args)
{
    m_gridView.SelectedIndex = -1;
    SaveAllEdits();
}

Are you sure the deselection fires the RowEditEnded? Because I had similar issues with a TextBoxe and a submit Button : the TextBox updates the boud DataContext with the latest changes on LostFocus by default (which is fired asynchronously).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM