Your approach would only work if you reload the entire tree (call CreateEditableCourts again, and replace the root with the new value).
Miguel On Sun, Nov 4, 2012 at 10:56 AM, Juan Manuel Gómez Álvarez < [email protected]> wrote: > Hello, > > I´m using MonoTouch.Dialog to make an editable ViewTable like the Alarm > app. I use two different Element, one when I don't edit (RadioElement) and > another when I am in edit mode (StringElement). > > private RootElement CreateEditablCourts (bool editable=false) > > { > > > var root = editable? new RootElement("Juzgados") : new RootElement( > "Juzgados",new RadioGroup(-1)); > > var section = new Section (); > > var courts = lawerData.getAllCourts(); > > foreach (var c in courts) { > > var court = c; > > section.Add(CreateEditableElement(court.Location,editable)); > > } > > root.Add(section); > > > return root; > > } > > > private Element CreateEditableElement (string caption, bool editable = > false) > > { > > if (editable) > > return new StringElement (caption, () => { > > new UIAlertView ().Show ();}); //NEVER TRIGGER > > > var radioElement = new RadioElement(caption,string.Empty); > > radioElement.Tapped+= () => { > new UIAlertView ().Show (); //WORKS > > } ; > > > return radioElement; > > > } > > > Thanks in advance, > _jmgomez_ > Juan M Gómez > > > _______________________________________________ > MonoTouch mailing list > [email protected] > http://lists.ximian.com/mailman/listinfo/monotouch > >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
