This is a migrated thread and some comments may be shown as answers.

Treeview not working with Guid.ToString() as ID/ParentID

7 Answers 285 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 07 Jul 2016, 04:02 PM
We have a simple Gantt chart, no dependencies, and are displaying tasks and subtasks.

My treelist of task/sub-tasks is not working correctly. I am using Guid.ToString() for this value. If a Summary designation is given, I get treelist arrows, but parent/child relationships are not being honored. Removing Summary for top-level tasks then removes any UI elements for treelists. I'm wondering If I am missing some required CSS files. I have been using all.less and gantt.less, and even tried throwing in treelist.less, but to no avail.

Any help and assistance is much appreciated. Let me know if you need further information.

7 Answers, 1 is accepted

Sort by
0
James
Top achievements
Rank 1
answered on 08 Jul 2016, 02:15 PM
I switched the IDs to int.ToString and still no treelist functionality. I checked the data being passed to the Gantt control and the ParentID correctly corresponds to a proper parent in the list.
0
James
Top achievements
Rank 1
answered on 08 Jul 2016, 06:46 PM
Attached an image to show the problem. The ParentID of the TestCollections sub task is the ID for the Manage CUstomer Experience task, with an OrderId of 0. 
0
James
Top achievements
Rank 1
answered on 08 Jul 2016, 06:54 PM

I was able to get the treelist working by setting my DataSource as follows:

.DataSource(d => d
            .ServerOperation(true)
            .Model(m =>
            {
                m.Id(f => f.Id);
                m.OrderId(f => f.OrderId);
                m.ParentId(f => f.ParentId);
            })
            .Read(read => read
                .Action("ReadTasks", "MyGanttController")
            )
        )

Will try using Guid.ToString() again as this is working for ints.

0
James
Top achievements
Rank 1
answered on 08 Jul 2016, 06:56 PM

Got this working for ints as IDs when setting the DataSource on the Gantt as follows:

.DataSource(d => d
            .ServerOperation(true)
            .Model(m =>
            {
                m.Id(f => f.Id);
                m.OrderId(f => f.OrderId);
                m.ParentId(f => f.ParentId);
            })
            .Read(read => read
                .Action("ReadTasks", "Capabilities")
                .Data("GetFilterOptionValues")
            )
        )

 

Will try with Guid.ToString() next.

0
James
Top achievements
Rank 1
answered on 08 Jul 2016, 07:32 PM
Does not work with Guid.
0
Accepted
Peter Milchev
Telerik team
answered on 11 Jul 2016, 03:10 PM
Hello James,

Setting the TaskId to be Guid should not be a problem. I should warn you that if you set the TaskId to be Guid, then the ParentId should be nullable Guid. Please find attached the controller, models and views I used to recreate your scenario. 

Regards,
Peter Milchev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
James
Top achievements
Rank 1
answered on 11 Jul 2016, 03:42 PM

Thanks, Peter.

I did get it working after some trial and error this weekend, and it looks a lot like the solution you put forth. Thanks!

Tags
Gantt
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or