Is possible to Drag and Drop columns?

5 posts, 1 answers
  1. Richard
    Richard  avatar
    17 posts
    Member since:
    Jun 2013

    Posted 13 Nov Link to this post

    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.

  2. Answer
    Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 16 Nov Link to this post

    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.
  3. Richard
    Richard  avatar
    17 posts
    Member since:
    Jun 2013

    Posted 16 Nov in reply to Dinko Link to this post

    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.

     

  4. Richard
    Richard  avatar
    17 posts
    Member since:
    Jun 2013

    Posted 16 Nov in reply to Richard Link to this post

    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...?
  5. Dinko
    Admin
    Dinko avatar
    462 posts

    Posted 21 Nov Link to this post

    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.
Back to Top