views:

54

answers:

1
// XmlDataSource Setup
XmlDataSource xds = new XmlDataSource();
xds.Data = @"
    <attributes>
        <attribute>ATTR1</attribute>
        <attribute>ATTR2</attribute>
    </attributes>";
xds.XPath = @"attributes/attribute";
xds.DataBind();

The XmlDataSource is used to render and modify contents in a Telerik RadGrid. How do I access the in-memory xml? I'd like to set it as a string value in a dto so it can be persisted in a database record.

MSDN XmlDataSourse.Save() Docs:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.xmldatasource.save.aspx

A: 

Update:

I got all happy because "duh" the XmlDataSource.Data property is read as well as write. However, I was unable to see changes from the client to the underlying xml.

I kept looking though and was able to find the GetXmlDocument() method.

// See the InnerXml property of the XmlDocument.
XmlDocument xdd = XmlDataSource1.GetXmlDocument();
string s = xdd.InnerXml;

I was able to observe changes from the client here.

If there is a more l33t way I'm all ears. :D

vitaminjeff