Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1025
How do you delete a DataRecord?
posted

I want to delete the currently selected record. How do I accomplish this? I have this, but it doesn't seem to do anything. I am bound to a dataview. 

theDataGrid.ExecuteCommand(DataPresenterCommands.StartEditMode);

theDataGrid.DataItems.Remove(theDataGrid.SelectedItems.Records[0]);

theDataGrid.ExecuteCommand(DataPresenterCommands.EndEditModeAndAcceptChanges);

Thanks,

Rod

Parents
No Data
Reply
  • 1025
    Verified Answer
    posted

    Nevermind, I figured it out myself...

    theDataGrid.ExecuteCommand(DataPresenterCommands.DeleteSelectedDataRecords);

Children