Hi Jacob,
Thanks for using Syncfusion products.
We can use the List<CustomClass> as a datasource for Treeview control. The reason for the “Argument Exception” issue in your application is, the parent id of Treeviewfield is in the type of Object of your custom class. We must declare the parent id of the Treeviewfiled in the type of String/Integer. Please refer the code snippet.
<Code>
[CS]
TreeViewFields fields = new TreeViewFields {
Id = "Modelid",
ParentId = "Regiseterid", //Must be in String/Integer
Text="Brand"
};
[CS]
</Code>
For your convenience we have prepared a simple sample to exhibit this behavior and it is available in the following link,
Kindly let us know, if you have any other queries.
Regards,
Sunil Prabakar C
Hi Jacob,
Thanks for your update.
We suspect this issue is due to referring higher version of Jquery in your application. Our Syncfusion controls are tested till Jquery version 1.8 and works fine without any issues till this specific version. If you are referring higher version of Jquery, the control cannot render properly. To overcome this reported issue, you can use "Jquery-Migrate" script file along with higher version Jquery. Please refer the below given code snippet which explains this behavior.
<Code>
[_Layout.CSHTML]
<script src="~/Scripts/jquery-2.0.1.min.js"></script>
<script src="~/Scripts/jquery-migrate-1.2.1.js"></script>
<Code>
Note: jquery-migrate.js is kept in script folder.
We have also prepared a simple sample to showcase this behavior and the sample can be downloaded from the link given below.
www.syncfusion.com/downloads/support/directtrac/109432/TreeView_113472-307278323.zip
Kindly let us know if you have any other queries.
Regards
Sunil Prabakar C