1 Replies - 342 Views - Last Post: 04 October 2012 - 02:05 PM Rate Topic: -----

#1 ckane55436  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-August 09

xml to datagrid

Posted 04 October 2012 - 02:00 PM

I have an exisitng gridview with predefined columns and existing data. I save the data to an XML file using DataSet.WriteXML().

When I read back the xml file with DataSet.ReadXML(), additional columns are added with the data. Of course I do not want the additional columns, so I am not sure how to get around this.
Is This A Good Question/Topic? 0
  • +

Replies To: xml to datagrid

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3589
  • View blog
  • Posts: 11,161
  • Joined: 05-May 12

Re: xml to datagrid

Posted 04 October 2012 - 02:05 PM

After you load your data the first time, set AutoGenerateColumns to false.
GridView: http://msdn.microsof...atecolumns.aspx
DataGridView: http://msdn.microsof...atecolumns.aspx
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1