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

Resize and reorder rows at same time

2 Answers 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nikituki
Top achievements
Rank 1
Nikituki asked on 13 Aug 2012, 01:54 PM
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 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Aug 2012, 07:06 AM
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.

0
Nikituki
Top achievements
Rank 1
answered on 14 Aug 2012, 10:53 AM
Thanks, it's working!

But resizing works only at column header, cursor on other columns doesn't changing.
Tags
GridView
Asked by
Nikituki
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Nikituki
Top achievements
Rank 1
Share this question
or