Home - Forums-.NET - FlyTreeView (ASP.NET) - not display normal before postback

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

not display normal before postback
Link Posted: 09-Feb-2009 21:47
protected void FlyTreeView_PopulateNodes(object sender, FlyTreeNodeEventArgs e) { ...... foreach (DataRow ouinfo in ds_Emp.Tables[0].Rows) { FlyTreeNode ftn = new FlyTreeNode(); ftn.Text = ouinfo["name"].ToString(); ftn.Tag = ouinfo["ou"].ToString(); ftn.Value = ouinfo["sip"].ToString(); ftn.NodeTypeID = "LoadProcess"; e.Node.ChildNodes.Add(ftn); } } why not display img before postback ?
Link Posted: 09-Feb-2009 23:47
Load-on-demand doesn't work with server templates.

The recommended approach for such cases is to use UpdatePanel control.
You just need to put FlyTreeView into it and set PostBackOnExpand to true. So async postback occur every time you expand some node.
Link Posted: 10-Feb-2009 22:33
Thank you very much, I have tried to use the updatepenal control, but it can not meet  my needs, I wonder if I can partly use the nodes with server templates and set PostBackOnExpand to true, and the other nodes set PostBackOnExpand to false, then only when expand the nodes with server templates postback, the others no postback .
Link Posted: 11-Feb-2009 00:25
Sure you can split it the way you need.

You can define two NodeTypes, one with template, and other one without server template.
And apply these NodeTypes automatically (with AutoApply... options) or using node.NodeTypeID property.