DataGridView has 7 columns with headers (ID, TITLE, AUTHOR, GENRE, PRICE, PUBLISH, DESCRIPTION). On data in datagridview from xml file, two columns order is changed and new order is (ID, AUTHOR,TITLE, GENRE, PRICE, PUBLISH, DESCRIPTION). What is reason behind this ?
Reading from the xml file
Application.DataSet dsFileData = new DataSet("Books");
dsFileData.ReadXml(lSoruceFile);
dgvBooksDetails.DataSource = dsFileData;
dgvBooksDetails.DataMember = "book";
You need to set AutoGenerateColumns
property to false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With