Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:24:40+00:00 2026-06-02T01:24:40+00:00

I have a listview which contains data in Details view mode. So now my

  • 0

I have a listview which contains data in Details view mode. So now my task is to take back up of data which ever i select from listview and create .xml file.I created a button “Export” and put a code to open “SaveFileDialog” in export_Click event handler.Now can anybody provide me the logic to achieve the task to create .xml file from the datas selected from listview in "export_Click” eventhandler .
This is the bit of listview code used in the existing application.

public class TrevoListView : System.Windows.Forms.ListView, IEditable
public class BaseLVItem : System.Windows.Forms.ListViewItem
      public TrevoListView ListView
      {
         get{ return t_listView; }
      }

If i iterate by using foreach loop , i will get each object like shown below, but i really stuck what logic i can do for creating xml?

foreach(BaseLVItem item in ListView.SelectedItems)

And one more thing these all datas displayed in listivew are from parent xml files. Server will serialize these xml and send it to GUI for displaying in controls like listview, we also have dataschema “TrevoDataSchema.xsd”
Do i need to use XDocument or any other logic in side export_Click event handler ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:24:41+00:00Added an answer on June 2, 2026 at 1:24 am

    You could use XDocument from LINQ to XML and create a XML file from the ListItems, as shown in this answer https://stackoverflow.com/a/4067146/64497

    And use

    XDocument.Save(filename)
    

    To save the xml file, filename here is the name returned by the SaveFileDialog

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a ListView which contains objects bound from an collection. The representation of
I'm having a windows form which contains listview control , where listView1.View = View.Details;
I have a listview NoteList which contains a method doListRefresh() to select list contents
I have a ListView which contains EMPLOYEE_NAME from a DB table EMPLOYEE. Some employees
I have a listview which is filled with data form sqlitedatabase. A list-view element
I have a ListView which contains custom rows. This custom row has following UI
I have ListView which is saving all data to database. For adding i have
I have a WPF ListView which repeats the data vertically. I cannot figure out
Hallo all, I have a ListView which contains a Button in each line. The
I have a problem with my listview which contains an ImageView and a few

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.