Hello,  

Have spent countless hours but can't figure out why a simple piece of code
is not working.

I have a UIViewController that has a tableview.

I have added Edit on the navigation bar but it doesn't seem to fire for some
reason.

At class-level I have a variable:
UIBarButtonItem buttonEdit;

Then in ViewDidLoad, I have
this.NavigationController.NavigationBarHidden = false;
this.buttonEdit = new UIBarButtonItem("Edit",UIBarButtonItemStyle.Bordered,
this.ButtonEdit_Clicked);
this.NavigationItem.HidesBackButton = true;
this.NavigationItem.SetRightBarButtonItem (this.buttonEdit, true);

And an event handler for Edit button:
public void ButtonEdit_Clicked(object sender, EventArgs e)
{
        this.MainTableVIew.SetEditing (true, true);
        this.NavigationItem.SetRightBarButtonItem (this.buttonDone, true);
        this.NavigationItem.SetLeftBarButtonItem (this.buttonAdd, true);
}
                
Can anyone explain why Edit button is not firing and any work round.

I have attached the full source code to the postcode.
                

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/UIBarButtonItems-are-not-firing-in-UIViewController-tp4633026.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to