Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Manipulating XML file using GridView and XmlDataSource

Manipulating XML file using GridView and XmlDataSource

Scheduled Pinned Locked Moved ASP.NET
cssxmlhelpannouncement
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sujay chakraborty
    wrote on last edited by
    #1

    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 implement e.Cancel = true; in the DataGrid1_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

    A 1 Reply Last reply
    0
    • S Sujay chakraborty

      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 implement e.Cancel = true; in the DataGrid1_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

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • A Abhijit Jana

        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

        S Offline
        S Offline
        Sujay chakraborty
        wrote on last edited by
        #3

        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

        C 1 Reply Last reply
        0
        • S Sujay chakraborty

          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

          C Offline
          C Offline
          chaitanya231
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups