Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
WebDataTree DataBinding Refreshment Issue
posted

Hi

I am creating a  web data tree on the fly, i bind it to xml data source every thing works fine but when i change my data source contents still the tree displays old data source contents !! if i recycle the application pool the new data source is reflected. I know it has something to do with xml datasource because when i change its id the new contents are retrieved 

 

 

 

 

 

WebDataTree

 

 

 

 

 

 tree = new WebDataTree();

tree.Width = new Unit(99, UnitType.Percentage);

tree.Height =

 

new Unit(99, UnitType.Percentage);

tree.EnableAutoChecking =

 

true;

myPanel.Controls.Add(tree);

 

 

XmlDataSource

 

 

 

xmlSource = new XmlDataSource();

xmlSource.ID =

 

"xmlSource1" ;

xmlSource.EnableCaching = false;

xmlSource.Data = "my xml";

 

 

 

DataTreeNodeBinding 

 

 

DimensionHierarchyBinding = new DataTreeNodeBinding();

 

DimensionHierarchyBinding.DataMember =

 

"TreeNode";

DimensionHierarchyBinding.TextField =

 

"NodeText";

DimensionHierarchyBinding.ValueField =

 

"NodeValue";

tree.DataBindings.Clear();

tree.DataBindings.Add(DimensionHierarchyBinding);

tree.DataSource = xmlSource;

tree.DataBind();

/*xml sample 

<TreeNode NodeText="Root">

<TreeNode NodeText="Dept1" NodeValue="1"/>

<TreeNode NodeText="Dept2" NodeValue="2"/>

</TreeNode>

*/