This question is locked. New answers and comments are not allowed.
Hi,
I have a self referencing table with 3 columns : function_id, function_parent_id, function_name (function_parent_id is null for the root function, others contain the id of their parent).
I would like to bind it server side to the treeview. I almost found the right code to do it using the nice sample provided here http://www.telerik.com/community/forums/aspnet-mvc/treeview/how-to-get-child-checkboxes-selected-when-parent-checkbox-is-selected.aspx#1141070 but I don't know the code I need to write in the Children method to finish it.
| <% Html.Telerik().TreeView() |
| .Name("TreeView") |
| .ShowCheckBox(true) |
| .ExpandAll(true) |
| .BindTo(Model as IEnumerable<Function>, mappings => |
| { |
| mappings.For<Function>(binding => binding |
| .ItemDataBound((item, function) => |
| { |
| item.Text = function.function_name; |
| item.Value = function.function_id.ToString() ; |
| }) |
| .Children(child => child.Functions)); |
| }) |
| .Render(); |
| %> |
The issue is that I want only function that have parent id NULL on the first level. On this solution all the functions are displayed on the root level.
How can I sort that ?
Best regards,