kos
kos

Reputation: 269

monotouch DialogViewController change order of elements

I am currently using the advanced editing tableview as outlined in Monotouch.Dialog that allows a user to delete as well as edit the label of table elements. Is there a way to enrich the tableview to achieve something similar to the screenshot, i.e. change the ordering?

rearrange order of table elements

Upvotes: 2

Views: 769

Answers (1)

Janub
Janub

Reputation: 1604

You need to add this two methods to your DialogViewController.Source

        public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath)
        {
            return true;
        }

        public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
        {
            tableView.MoveRow(sourceIndexPath,destinationIndexPath);
        }

Upvotes: 5

Related Questions