473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ascp.net Treeview and Datasource out of synch

Hello,

I am populating a tree with a XmlDataSource, and although I am
explicitly databinding it to the source upon every change in the xml's
structure, it will show the changes only after I rebuild the website.
The XmlDatasource receives the updated xml (shows in Debugger).

some code:
<asp:XmlDataSource ID="XmlDataSourceDocuments" runat="server"
XPath="/site/*"></asp:XmlDataSource>
<asp:TreeView ID="TreeViewDocuments" runat="server"
DataSourceID="XmlDataSourceDocuments"
OnSelectedNodeChanged="TreeViewDocuments_SelectedN odeChanged"
ImageSet="Arrows">
<DataBindings>
<asp:TreeNodeBinding DataMember="site:document"
ValueField="path" TextField="name" PopulateOnDemand="True" />
</DataBindings>
</asp:TreeView>

private void fillTree()
{
XmlHelper h = new XmlHelper();
XmlDataSourceDocuments.Data =
h.CreateXmlString(PhysicalStructure.Xml); // Data is up to date!
XmlDataSourceDocuments.DataBind(); // does not show up to date data!
}

protected void ButtonSaveChanges_Click(object sender, EventArgs e)
{
loadDocument(path);
if (document == null) {
createDocument(path);
} else {
///...
}
}

private void createDocument(string path)
{
XmlDocument prototype = new XmlDocument();
prototype.InnerXml = string.Format(@"<?xml version='1.0' ?><Entry
pubdate='{0}' id='{1}'/>", makeDateString(), fi.Name.Replace(".xml",
string.Empty));
prototype.Save(path);
fillTree();
loadDocument(path);
}

I tried implicitly clearing the tree before populating, disabled
PopulateFromClient but to no avail. The only thing that helps is rebuilding.
Thanks for any help!

Jan
Sep 24 '06 #1
0 1237

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: serge calderara | last post by:
dear all, Is there an easy way to bind a treeview control with an XML object as datasource? In a similar way as the dataset is doing, and build columns accroding to XML node, I could imagine a...
2
by: Craig | last post by:
Is there a way to "tie" or "bind" an XmlDocument to a treeView, so the changes in the treeView can automatically be reflected in the XmlDocument object? (Like DataSource for a ListBox) If not,...
2
by: Ryo | last post by:
Hello ! I have an XmlDocument in memory and I want to put this document as datasource of my treeview. How to do this ? Thanks.
0
by: Ryo | last post by:
Hello ! I have this simple aspx page: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_treeview.aspx.cs" Inherits="test_treeview" Title="Treeview" %> <asp:Content...
5
by: Paul | last post by:
Hi, I am a self taught VBA programmer, and I'm trying to learn VB2005 Express (The price was right). I like the look of the treeview control, and I'd like to use it as a menu system for my users,...
26
by: JJ | last post by:
Is there any way you can expand a parent node on the treeview control _without a postback_ by clicking on the node text (NOT clicking the expand image URL) ? I want to format the treeview node...
3
by: =?Utf-8?B?TGVzbGll?= | last post by:
Using Visual Studio 2005 SP1 I am attempting to dynamically load a treeview control. I create an XmlDataSource and then load the data source using XmlDataSource.Data. I Load my XML string into...
0
by: Dennis Francek | last post by:
Hello I have populated a treeview from my dataset and by clicking in the treeview i want to get the corresponding table shown in a datagridview. Ive managed this by looking at each DataRow and...
2
by: =?Utf-8?B?QnJpYW4gTmljaG9sc29u?= | last post by:
Hello -- I'm having problems figuring out how to bind an XML file to a treeview control. I have the following test XML: <?xml version="1.0" encoding="utf-8"?> <instruments> <instrument...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.