G
Guest
Hello !
I have this simple aspx page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="test_treeview.aspx.cs" Inherits="test_treeview" Title="Treeview" %>
<asp:Content ID="cntCorpCentre" ContentPlaceHolderID="cphCorpCentre"
EnableViewState="false" RunAt="Server">
<asp:TreeView ID="Organigramme" SkinID="Organigramme"
EnableViewState="false" RunAt="server" />
</asp:Content>
And the associated code:
using System;
using System.Web.UI.WebControls;
using System.Xml;
public partial class test_treeview : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
XmlDataSource xdsOrganigramme = new XmlDataSource();
System.Windows.Forms.MessageBox.Show(new Organigramme().xml.InnerXml);
xdsOrganigramme.Data = new Organigramme().xml.InnerXml;
xdsOrganigramme.DataBind();
System.Windows.Forms.MessageBox.Show(xdsOrganigramme.Data);
Organigramme.DataSource = xdsOrganigramme;
Organigramme.DataBind();
System.Windows.Forms.MessageBox.Show((Organigramme.DataSource as
XmlDataSource).Data);
xdsOrganigramme.Dispose();
}
}
new Organigramme().xml.InnerXml return the content of a generated XML file
like this:
<?xml version="1.0" encoding="utf-8">
<Society>
<Computing>
<User Name="Ryo"/>
</Computing>
<Finance>
<User Name="Bill"/>
</Finance>
</Society>
For this the treeview seem like that:
Society
|-Computing
| |-Ryo
|
|-Finance
| |-Bill
Now, I put Bill in computing and I reload the page.
The XML of the DataSource of the Treeview is like that:
<?xml version="1.0" encoding="utf-8">
<Society>
<Computing>
<User Name="Ryo"/>
<User Name="Bill"/>
</Computing>
</Society>
But the displayed treeview is always:
Society
|-Computing
| |-Ryo
|
|-Finance
| |-Bill
Why changes are not reflected on my treeview ? How to change this ?
Thanks in advance.
I have this simple aspx page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="test_treeview.aspx.cs" Inherits="test_treeview" Title="Treeview" %>
<asp:Content ID="cntCorpCentre" ContentPlaceHolderID="cphCorpCentre"
EnableViewState="false" RunAt="Server">
<asp:TreeView ID="Organigramme" SkinID="Organigramme"
EnableViewState="false" RunAt="server" />
</asp:Content>
And the associated code:
using System;
using System.Web.UI.WebControls;
using System.Xml;
public partial class test_treeview : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
XmlDataSource xdsOrganigramme = new XmlDataSource();
System.Windows.Forms.MessageBox.Show(new Organigramme().xml.InnerXml);
xdsOrganigramme.Data = new Organigramme().xml.InnerXml;
xdsOrganigramme.DataBind();
System.Windows.Forms.MessageBox.Show(xdsOrganigramme.Data);
Organigramme.DataSource = xdsOrganigramme;
Organigramme.DataBind();
System.Windows.Forms.MessageBox.Show((Organigramme.DataSource as
XmlDataSource).Data);
xdsOrganigramme.Dispose();
}
}
new Organigramme().xml.InnerXml return the content of a generated XML file
like this:
<?xml version="1.0" encoding="utf-8">
<Society>
<Computing>
<User Name="Ryo"/>
</Computing>
<Finance>
<User Name="Bill"/>
</Finance>
</Society>
For this the treeview seem like that:
Society
|-Computing
| |-Ryo
|
|-Finance
| |-Bill
Now, I put Bill in computing and I reload the page.
The XML of the DataSource of the Treeview is like that:
<?xml version="1.0" encoding="utf-8">
<Society>
<Computing>
<User Name="Ryo"/>
<User Name="Bill"/>
</Computing>
</Society>
But the displayed treeview is always:
Society
|-Computing
| |-Ryo
|
|-Finance
| |-Bill
Why changes are not reflected on my treeview ? How to change this ?
Thanks in advance.