Web TreeView Dynamic binding on Page_Load

3 replies. Last post: February 10, 2016 7:49 AM by Yudi
Tags :
My Datasource is a List<> from which I am parsing and binding treeview on Page_Load event. 
But binding on Load causing none of treeview events i.e Drag Drop, NodeMove, NodeAdd etc. working properly. 

It seems that Web Treeview is working correctly only for XML and SiteMap datasource but not ObjectDatasource. 

Can you please provide me any sample available for objectDataSource for DragDrop, NodeMove, NodeAdd, NodeDelete.

We have already purchased your control. Please answer.

All Replies

Yudi Member

I created a simple sample of WebTreeView based on your description. The data source is a List and the treeview node is contructed on Page_Load event.

Following treeview events: Drag Drop, NodeMove, NodeAdd - are working as expected. Please have the attached sample evaluated on your end and let me know if you have different result.

Thank you Yudi for your reply. 

I have modified your sample and just added AutoPostback setting for Add, Selected, DragDrop and Move. My application requires these server side events to display values in tabs.

Please go through the attachment (WebTreeview Sample Enhanced.zip) now you can see that None of functionality working correctly. Events are not firing.

Please let me know how your WebTreeview control works on postback. 

Waiting for your reply. Thanks.

Regards,

Shailendra Singh


Yudi Member

By enabling AutoPostBackSettings and specific action is executed (in this case: drag-drop, node add, node check changed, node delete, and node edit), WebTreeView will call specified event handler at server-side where developer can perform additional action based on that event.

Try to set PostBackModeType property to FlyPostBack to have advantages from both world. Event handler at server-side and client-side events are firing.

The changes can be seen in the following snippet code:

<ISWebTreeView:WebTreeView ID="WebTreeView2" runat="server"
    ...
    AllowAddNode="True" AllowDeleteNode="True" AllowNodeEditing="Yes"
    OnNodeSelectChanged="WebTreeView2_NodeSelectChanged"
    PostBackModeType="FlyPostBack">
    <AutoPostBackSettings OnDragDrop="true" OnNodeAdd="true"
        OnNodeMove="true" OnNodeSelectChanged="True" />
    <DragDropSettings AllowRootDrop="True" AllowChildDrop="True"
        AllowLeafDrop="True" AllowSiblingDrop="True" />
    <NodeSettings EnableAnimation="True" />
    <ClientSideEvents OnDragDrop="OnDragDrop" OnNodeMove="OnNodeMove"
        OnNodeAdd="OnNodeAdd" />
</ISWebTreeView:WebTreeView>

This should helps.

All times are GMT -5. The time now is 7:28 AM.
Previous Next