Resize and reorder rows at same time

3 posts, 0 answers
  1. Nikituki
    Nikituki avatar
    34 posts
    Member since:
    Nov 2011

    Posted 13 Aug 2012 Link to this post

    Hello,

    When i'm trying to implement reordering rows such as in yours example, row resizing stops working.
    Mouse cursor changing to SizeNS, but instead resizing goes reordering.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Aug 2012 Link to this post

    Hello,

     If you are using RowReorderBehavior from this demo here is how to change OnDragInitialize:

    private void OnDragInitialize(object sender, DragInitializeEventArgs e)
    {
                var source = e.OriginalSource as FrameworkElement;
                if (source != null && source.Name != "PART_RowResizer")
                {
                    DropIndicationDetails details = new DropIndicationDetails();
                    var item = (sender as RadGridView).SelectedItem;
                    details.CurrentDraggedItem = item;


                    IDragPayload dragPayload = DragDropPayloadManager.GeneratePayload(null);


                    dragPayload.SetData("DraggedItem", item);
                    dragPayload.SetData("DropDetails", details);


                    e.Data = dragPayload;


                    e.DragVisual = new DragVisual()
                    {
                        Content = details,
                        ContentTemplate = this.AssociatedObject.Resources["DraggedItemTemplate"] as DataTemplate
                    };
                    e.DragVisualOffset = e.RelativeStartPoint;
                    e.AllowedEffects = DragDropEffects.All;
                }
    }

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Nikituki
    Nikituki avatar
    34 posts
    Member since:
    Nov 2011

    Posted 14 Aug 2012 Link to this post

    Thanks, it's working!

    But resizing works only at column header, cursor on other columns doesn't changing.
Back to Top