Hello,
I have a WebDataTree that is bound to a XmlDataSource. I set XmlDataSource.Data at runtime in Page_Init and everything is OK. I have a Button that do Postback, make some changes to the xml data, set XmlDataSource.Data = new_xml_data and tries to rebind the tree. But when the page is shown the Tree contains the old xml. XmlDataSource is with EnableCaching="false" EnableViewState="false" and WebDataTree is with iewStateMode="Disabled".
Here is sample code:
<ig:WebDataTree ID="WebDataTree1" runat="server" Height="300px" Width="200px" ViewStateMode="Disabled" InitialExpandDepth="10" NodeIndent="10" DataSourceID="xmlDsTree"> </ig:WebDataTree> <asp:XmlDataSource ID="xmlDsTree" runat="server" EnableCaching="false" EnableViewState="false" ></asp:XmlDataSource> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
string Xml { get { return (string)Session["Xml"]; } set { Session["Xml"] = value; } } protected void Page_Init(object sender, EventArgs e) { if (!IsPostBack) { Xml = "<a><b></b></a>"; } xmlDsTree.Data = Xml; } protected void Button1_Click(object sender, EventArgs e) { Xml = "<a><b><c></c></b></a>"; xmlDsTree.Data = Xml; WebDataTree1.DataBind(); }
Hello ppopov,
I guess that the issue is caused by some functionality which works in different way in 3.5 and 4.0
.Net frameworks
I was able to reproduce the issue when using CRL 4.0 as a target framework.
I solved the issue by adding the following code snippet
protected void Button1_Click(object sender, EventArgs e)
{
Xml = "<a><b><c></c></b></a>";
xmlDsTree.Data = Xml;
WebDataTree1.DataSource = null;
WebDataTree1.DataSourceID = "xmlDsTree";
WebDataTree1.DataBind();
}
Let me know if you need further assistance regarding this.
The version is Infragistics4.Web.v10.3, Version=10.3.20103.2013