6rant6
asked on
Updating xmldatasource from gridview
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="Tr ue" >
</asp:GridView>
<asp:XmlDataSource ID="XmlSegments" runat="server"
datafile="App_Data/Segment s.xml"></a sp:XmlData Source>
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?
Here's the bit out of the .aspx file:
<asp:GridView ID="GridView1" runat="server" DataSourceID="XmlSegments"
AutoGenerateEditButton="Tr
</asp:GridView>
<asp:XmlDataSource ID="XmlSegments" runat="server"
datafile="App_Data/Segment
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I guess the best anyone can come up with is Google MSDN?
ASKER