in wpf app, wrote code editing contents of listbox items. edit process working fine. after editing want save changes in listbox itself. how that?
my listbox consist of horizontal stackpanel of 6 textboxes.
as used templates in app, code is,
private void editbutton_click(object sender, routedeventargs e) { datatemplate tmpl= (datatemplate)this.findresource("defaultdatatemplate"); if (listbox1.itemtemplate == tmpl) { tmpl = (datatemplate)this.findresource("editabledatatemplate"); listbox1.itemtemplate = tmpl; this.editbutton.content = "done editing"; } else { tmpl = (datatemplate)this.findresource("defaultdatatemplate"); listbox1.itemtemplate = tmpl; this.editbutton.content = "edit"; } // want add here save contents. }
Comments
Post a Comment