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

Load & Save Sort Order

3 Answers 53 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 02 Jun 2017, 07:33 PM

Hi,
Was wondering on how I can access the sort order of items in the list so I can save their order?

3 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 07 Jun 2017, 10:52 AM
Hi Derek,

There is no built in logic for sorting the TasksSource of the RadGanttView.
It is of type IEnumerable, thus whatever IEnumerable you choose to use will determine how the tasks are sorted. Could you provide more information of your scenario and what you wish to achieve in order for us to get a better understanding?

Regards,
Polya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Derek
Top achievements
Rank 1
answered on 07 Jun 2017, 12:58 PM
I'm trying to get the drag and drop reorder. So when they move an item up and down, I can get the position number.
0
Polya
Telerik team
answered on 09 Jun 2017, 08:13 PM
Hello Derek,

The implementation of GanttTasks does not provide an order number out of the box. However, you can create a custom GanttTask and include additional properties that suit the needs of your application, in this case a property for the GanttTask order. You can find more information on how to create a custom GanttTask in this help article: http://docs.telerik.com/devtools/wpf/controls/radganttview/features/items/custom-gantttask

Then you can also create a custom GanttDragDropBehavior and override its Drop method, where you can extract the dragged GanttTask, its destination GanttTask and the drop position from the state method parameter and adjust the order properties accordingly. You can find more information on how to create a custom GanttDragDropBehavior in our Custom Drag and Drop behaviors help article.

Hope this helps.

Regards,
Polya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GanttView
Asked by
Derek
Top achievements
Rank 1
Answers by
Polya
Telerik team
Derek
Top achievements
Rank 1
Share this question
or