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

Is possible to Drag and Drop columns?

4 Answers 81 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Iron
Richard asked on 13 Nov 2017, 06:06 PM

Hi.

I got a request from one of our users to be able to reorder the resource columns. Is there a way to accomplish it with drag and drop?

Thanks.

4 Answers, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 16 Nov 2017, 11:34 AM
Hello,

Thank you for contacting us.

With the current implementation, RadScheduleView does not provide the desired by you functionality out of the box. The resources could only be re-arranged by reordering the Resources in the Resources collection itself. Please, check the attached sample that demonstrates that - by reordering the items in the ListBox the Resources are reorder either and this is the only approach that currently we could suggest you to use.

Regards,
Dinko
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
Richard
Top achievements
Rank 1
Iron
answered on 16 Nov 2017, 04:53 PM

Thanks!

After sending the message I figured that it should be something like that...

I'll try and let you know. What I really want is to be able to directly drag the columns, but that will involve some kind of context when they are grouped... Well. Back to the desk.

 

0
Richard
Top achievements
Rank 1
Iron
answered on 16 Nov 2017, 07:56 PM

HI.

Well, I have it working now.

But I just wanted to share that I didn't need to rebuild the whole list.

I just re-set the ResourceTypes collection, and it worked (which makes sense, since I bind the listbox ItemsSource to the resources list, which means that the resources are actually reordered).

So, instead of re-creating the resources list I just did:

        void Resources_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null)
            {
                var result = ResourceTypes;
                ResourceTypes = null;
                ResourceTypes = result;
            }
        }

Am I missing something...?
0
Dinko | Tech Support Engineer
Telerik team
answered on 21 Nov 2017, 12:57 PM
Hi Richard,

Indeed your approach seems meaningful. You can just reset the ResourcesTypes collection as the ListBox is bound to it and when the CollectionChanged event is called the items are already reordered. You can use your approach if it fits into your main application.

Regards,
Dinko
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
ScheduleView
Asked by
Richard
Top achievements
Rank 1
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Richard
Top achievements
Rank 1
Iron
Share this question
or