Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I was stuck in Deletng Listbox Box items from XML file. i dont have any idea how to do it in C#, WPF..
Please any knows give me some idea how to do it..

What I have tried:

In my code i was have one listbox, it take item from TextBox and listbox item are SAVED in XML file.. my problem is when i select one item in Listbox and click DELETE button that selected item deleted from listbox and also delete from XML file too...

XML file as like this :
C#
<?xml version="1.0" encoding="utf-8"?>
<information ... >
   <Number1>9876543210</Number1>
   <Number2>9876543210</Number2>
   <Number3>9876543210</Number3>
   <Number4>9876543210</Number4>
   <Number5>9876543210</Number5>
</information>
Posted
Updated 3-Jun-20 17:40pm
Comments
Maciej Los 4-Jun-20 3:19am    
This makes no sense. If you can add data into xml, you should be able to delete them.
Share your code (C# and XAML).

1 solution

Deserialize xml to a class; load items from class to listbox; update items; copy items to class; serialize class to xml.

local XML to Listbox in c# - Stack Overflow[^]
 
Share this answer
 
Comments
Maciej Los 4-Jun-20 3:20am    
Short And To The Point!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900