We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem/Bug while LoadOnDemand on treeview

Hello,

I have a problem when expanding a node from a Treeview, using LoadOnDemand.

When clicking to a LoadOnDemand node, I set the child nodes checked property in server side to its parent value (the one which has been clicking : loadondemand node).

But then, if I immediately do a postback in the page, the childs nodes on which I have set the checked property are always "false" ! never true, even if they where checked after the LoadOnDemand server side event.

But something I noticed, is that afterthe LoadOnDemand has been done, if I check and uncheck the parent of the childs (the node on with LoadOnDemand), and if the treeview property AutoCheckChildNodes is true, then the bug is fixed. But it is not a solution for me.

Also, this bug (?) can easily be observed if you set a ClientObjectId to the treeview, and use the treeviewClientId.Refresh() method instead of doing a postback. The treeview will be refresh, and you'll see that the child nodes, are always checked to false, even if the LoadOnDemand server side code has set them to true.

Notice that this problem is with enableviewstate=true for the page and

---> I think the problem should come from the viewstate which is not updated after a LoadOnDemand event by the syncfusion API. But is correctly updated after checking/unchecking the node (with the AutoCheckChildNodes=true)

Two solutions I would like to try are :
-------------------------------------

1) execute ClienScriptBlock with the ScriptManager like Page.ClientScript.RegisterClientScriptBlock("myJavascript") or myScriptManager.RegisterClientScriptBlock("myJavascript") in order to check/uncheck the parent node of the child nodes, because I noticed that checking/unchecking on client side, after the LoadOnDemand be done, fixed the bug (a bad way to fix it)

2) Use an event like ClientSideOnLoadOnDemandExpanded but there is no event like this on the syncfusion Treeview.. (Notice that the ClientSideOnNodeExpand doens work with the LoadOnDemand -> it's another bug!!)
A ClientSideOnLoadOnDemandExpanded would help me to check/uncheck the parent node, as solution 1)


-----------
Can you help me please ?
-----------

Thanks a lot !


1 Reply

RS Rajarajeswari S Syncfusion Team January 10, 2008 01:34 PM UTC


Hi Christophe,

Thanks for using Syncfusion products.

1) On a postback of the page, the childs nodes on which I have set the checked property are always "false" ! never true,

The issue mentioned here is suspected to be a defect and we have sent this to our development team for more analysis. We will update you once we get back from our development team.

2) I do not know how to execute some javascript when a LoadOnDemand has been done. How can I do it ?

Please refer the browser sample from the below link where you can get the JavaScript code to access the node:

C:\Documents and Settings\User Name\My Documents\Syncfusion\EssentialStudio\5.1.0.51\Web\tools.web\Samples\2.0\TreePackage\TreeView- Basic Features\ClientsideObjectModel\cs

Please let me know if you have any other concerns.

Thanks for your patience.

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon