?
Solved

Updating xmldatasource from gridview

Posted on 2010-09-02
3
Medium Priority
?
662 Views
Last Modified: 2013-11-27
I have a gridview which is populated from an xmldatasource, "xmlSegments" (from an .xml file in App_Data).

Here's the bit out of the .aspx file:
 
        <asp:GridView ID="GridView1" runat="server" DataSourceID="XmlSegments"
            AutoGenerateEditButton="True"  >
          </asp:GridView>

  <asp:XmlDataSource ID="XmlSegments" runat="server"
        datafile="App_Data/Segments.xml"></asp:XmlDataSource>

I can edit the data, and when I look at it via the snippet below, I see the values are updated:

        For Each cl As TableCell In editingRow.Controls

            Dim contrl As Control = cl.Controls(0)
            If TypeOf contrl Is TextBox Then
                Dim newText As String = CType(contrl, TextBox).Text
            End If
        Next


However, when I write the .xml back via

   XmlSegments.Save()

The changes are not captured. What do I need to do before I write the file?
0
Comment
Question by:6rant6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1000 total points
ID: 33591706
Please view the section "Editing XML Data Using the XmlDataSource Control" here:  http://msdn.microsoft.com/en-us/library/494y92bs.aspx
0
 
LVL 1

Author Comment

by:6rant6
ID: 33592680
Yes, I'd read that before.
0
 
LVL 1

Author Closing Comment

by:6rant6
ID: 33647930
I guess the best anyone can come up with is Google MSDN?
0

Featured Post

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question