Hi Muhammad,
Greetings from Syncfusion support.
In the attached sample, you have declared the navigateURL directly inside the fields tag. So that it is not working properly. We have to define the navigateURL individually for each node (like id, parentID defined for each node). Please find the code snippet.
// Controller part
public string nodeURL { get; set; }
TreeData.Add(new ParentNodeViewModel { nodeId = "01", nodeText= "Local Disk (C:)", expanded= true, hasChild= true, nodeURL="/Home/About" });
TreeData.Add(new ParentNodeViewModel { nodeId = "01-01", nodeText = "Program Files", hasChild = true, pid = "01", nodeURL= "https://ej2.syncfusion.com/demos/#/material/treeview/check-box.html" }); |
//view part
<ejs-treeview id="tree">
<e-treeview-fields navigateUrl="nodeURL" id="nodeId" parentId="pid" text="nodeText" hasChildren="hasChild" expanded="expanded">
<e-data-manager url="/Treeview/GetAllData" adaptor="ODataV4Adaptor" crossDomain="true" offline="true"></e-data-manager>
</e-treeview-fields>
</ejs-treeview> |
Please check the above sample and get back to us if you need any further assistance.
Thanks,
Christo