How to delete a cell from tableview on custom button click?

sumitmishrasumitmishra Member ✭✭

We have to delete a cell from tableview on delete button click not using swipe or CommitEditingStyle method. We have a method that delete data from database properly but we are unable to delete cell from Tableview. We are using

tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

In our method and we are passing indexpath as parameter that I hold in a properties on binding. When we debug our code everything is ok indexpath also showing but it's throw exception.

Can you please guide how can I delete a cell on button click. We are using custom view controller to bind cell.


  • ColeXColeX Member, Xamarin Team Xamurai

    You have to change the row number returned in Method RowsInSection , it should be the one lower than before.

Sign In or Register to comment.