Manipulating XML file using GridView and XmlDataSource
-
Hello everyone, I am designing one simple application where i want to insert, update and delete a XML file using DataGrid and XmlDataSource. I am done with adding and deleting code, but one thing i am stuck with is i cannot view the updated or deleted data back to the grid view after the page gets post back when we click the add or delete button although i have check the xml file and the data gets added and deleted respectively. I have tried with
DataGrid1.DataBind()
method but its not working. To add and delete data programatically i have to implemente.Cancel = true;
in theDataGrid1_RowDeleting
event(without this it won't work). please tell me a way to dynamically reflect the updated data back to the grid view Waiting for a quick response. Thanks in advance Regards -
Hello everyone, I am designing one simple application where i want to insert, update and delete a XML file using DataGrid and XmlDataSource. I am done with adding and deleting code, but one thing i am stuck with is i cannot view the updated or deleted data back to the grid view after the page gets post back when we click the add or delete button although i have check the xml file and the data gets added and deleted respectively. I have tried with
DataGrid1.DataBind()
method but its not working. To add and delete data programatically i have to implemente.Cancel = true;
in theDataGrid1_RowDeleting
event(without this it won't work). please tell me a way to dynamically reflect the updated data back to the grid view Waiting for a quick response. Thanks in advance RegardsWhere did you load the data? Can you please put the GridView Data Load Code ? Did you check the Page.ISPostback while loading the data on gridview ?
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
Where did you load the data? Can you please put the GridView Data Load Code ? Did you check the Page.ISPostback while loading the data on gridview ?
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
Thanks for replying. Actually i have used an XmlDataSource and set its DataFile property to the xml file and set the DataGird's DataSourceID property to the XmlDataSource. I have given the XPath rules to the grid view colomns to display the data. Well m sure i have done some mistake but where i have done it i couldn't figure it out. Please help Regards
-
Thanks for replying. Actually i have used an XmlDataSource and set its DataFile property to the xml file and set the DataGird's DataSourceID property to the XmlDataSource. I have given the XPath rules to the grid view colomns to display the data. Well m sure i have done some mistake but where i have done it i couldn't figure it out. Please help Regards
hi.. even i am facing the same problem. can some one pls help me soon. i have a XMLDataSource for which i mentioned the datafile to 'MyXml'. In my page i have a textbox and a button 'add' for adding the text to the xml and display the same in the datagrid. but wen i click that add button the data is getting updated in xml file and i can see that, but in the datagrid it is not getting updated. pls help soon.thanx in advance.