CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Datagridview to XML file

    I'm making a form that has some text and comboboxes and below
    a datagridview. all this data has to be stored in a XML file.

    The normal components i have stored that's easy.
    but i've been trying for a day now to get the data from the datagridview to the XML file.

    I read enough about people who use a dataset and store that to a XML file
    but i didn't find a way to get the data that the user put in the datagridview into the dataset.

    if there are any quiestions i'm happy to answer them
    and i hope there is someone here who can help me.

  2. #2
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: Datagridview to XML file

    The first question is how does the data get into the grid view? Is this a Windows or ASP.NET grid? I'm sure you can find samples of databinding with Grid Views. What I would say though is that its unlikely you'll find anything out of the box that will write to an xml file. You could bind to a dataset and then you the 'WriteXml' to output to Xml.
    Last edited by nelo; February 5th, 2010 at 04:38 AM. Reason: Correctness...

  3. #3
    Join Date
    Jan 2010
    Posts
    2

    Re: Datagridview to XML file

    I'm using C# for a windows form so windows, and the user have to put in the data by hand and i want that data to be stored in XML.
    indeed i have to use databindings but couldn't find any code to bind a new grid to a dataset and process that into XML. all the code i found was the other way around. read from xml to dataset and write it back. but the writing back is done with some code used for filling the grid.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width