This question is locked. New answers and comments are not allowed.
Hi,
I'm having trouble adding elements to the TreeListView in Lightswitch if I want to add below the root. I have a basic self referencing table : [ID, Code, Description, ParentID] served up by a WCF service. I have managed to get the hierarchical data to display in a Lightswitch screen by wrapping the TreeListView in a Custom Control. In order to get adding rows to work (hooking into TreeListView_AddingNewDataItem didn't work out), I had to roll a custom modal dialog that prior to showing, sets the Parent property of the new object equal to the object bound at the row selected by the user in the TreeListView, as well as adds the new object to the Children collection of the parent. My problem is that the node always shows up at the root level. I can't get it to appear as a child of the selected item. When creating the new object, I use the AddNew() method of the Parent objects Children property (i.e. parent.CategoryChildren.AddNew() ).
Are there any tips or suggestions on how to go about doing this in Lightswitch? Any help would be appreciated.
Thanks.
Alex.
I'm having trouble adding elements to the TreeListView in Lightswitch if I want to add below the root. I have a basic self referencing table : [ID, Code, Description, ParentID] served up by a WCF service. I have managed to get the hierarchical data to display in a Lightswitch screen by wrapping the TreeListView in a Custom Control. In order to get adding rows to work (hooking into TreeListView_AddingNewDataItem didn't work out), I had to roll a custom modal dialog that prior to showing, sets the Parent property of the new object equal to the object bound at the row selected by the user in the TreeListView, as well as adds the new object to the Children collection of the parent. My problem is that the node always shows up at the root level. I can't get it to appear as a child of the selected item. When creating the new object, I use the AddNew() method of the Parent objects Children property (i.e. parent.CategoryChildren.AddNew() ).
Are there any tips or suggestions on how to go about doing this in Lightswitch? Any help would be appreciated.
Thanks.
Alex.