I am trying to create a treeview with hierarchical structure.
CIK
|__Series
|__Class
Series will be populated from the database based on the currently selected CIK value member(Id). Class will be populated from the database based on the Series ID selected.
I couldn't find the right sample in the documentation to do this. Please point me in the right direction. Thank you for your help.
4 Answers, 1 is accepted
Thank you for writing.
RadTreeView has the ability to bind to related data of custom objects which have member collections of related objects (ORM generated classes for example). You can refer to the following help article: http://docs.telerik.com/devtools/winforms/treeview/data-binding/binding-to-object-relational-data
Alternatively, you can use the load on demand feature which helps reduce performance and memory costs incurred when all nodes are loaded at one time. Additional information is available here: http://docs.telerik.com/devtools/winforms/treeview/data-binding/load-on-demand
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik
Thank you for your reply Dess.I have gone through that documentation. But i am still puzzled on how to apply it for my scenario.
radTreeView1.DataSource = ckDao.GetCikListFromFileId(fileId);
radTreeView1.DisplayMember = "CikName";
radTreeView1.ValueMember = "CikId";
I was able to get parent level display correctly. But now to bring the list of children from the database i need the parent CikId to retrieve its children. I need to be able to call "GetSeriesListFromDatabase(cikId, fileId);" and set it as child member. and then invoke third level of data based on parent's series Id.
radTreeView1.ChildMember = sDao.GetSeriesListFromFileId(TxtJobNum.Text, ?? )
Thank you.
Never mind. I just had to build my collection in data layer separately and then bind it to the tree control just like in the "binding to object relational document" data. I was able to get it to display all levels properly.
Thank you for pointing in the right direction.
Thank you for writing back.
If you have the whole data for the three data collections in advance, you can use the data binding approach demonstrated in the firstly referred help article from my previous post. However, it may be more suitable to use the load on demand approach. Thus, when a node is expanded you can extract the relevant child nodes considering the parent node's id.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik