Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Save edited listbox items

$
0
0

In my wpf app, I wrote code for editing contents of listbox items. Edit process is working fine. After editing I want to save those changes on that place only where I changed. so when I visit next time, there should be updated contents there.. How could I do that?

My listbox consist of Horizontal stackpanel of six textboxes.

As I used templates in my app, my code is,

    privatevoidEditButton_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";}// I just want to add here something to save those contents.}


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>