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

drag with DraggedItemTemplate from gridview to scheduleview

2 Answers 121 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
guy
Top achievements
Rank 1
guy asked on 24 Sep 2012, 01:42 PM
hi 
i want to display text with datasource values wile draging from gridview to scheduleview 

im using this template 

<telerik:RadGridView.Resources>
                        <DataTemplate x:Key="DraggedItemTemplate">
                            <StackPanel>
                                <StackPanel Orientation="Horizontal">                                   
                                    <TextBlock Text="{Binding CurrentDraggedItem.name}" FontWeight="Bold"/>
                                    <TextBlock Text="/>
                                </StackPanel>                              
                            </StackPanel>
                        </DataTemplate>
                    </telerik:RadGridView.Resources>



this is the event i use
 private void OnDragInitialize(object sender, DragInitializeEventArgs e)
        {
           
            DropIndicationDetails details = new DropIndicationDetails();            
            var item = (sender as RadGridView).SelectedItem;
            details.CurrentDraggedItem = item;


            IDragPayload dragPayload = DragDropPayloadManager.GeneratePayload(null);


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


            e.Data = dragPayload;
            e.DragVisual = new Telerik.Windows.DragDrop.DragVisual()
            {
                Content = details,
                ContentTemplate = territorymanagementactionitems.Resources["DraggedItemTemplate"] as DataTemplate
            };
            e.DragVisualOffset = e.RelativeStartPoint;
            e.AllowedEffects = DragDropEffects.All;
        }


the problem is that the drop(on the scheduleview) is disabled 
how can i enable it?

2 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 24 Sep 2012, 01:46 PM
Hello Guy,

Have you tried setting AllowDrop to true on the RadScheduleView?

All the best,
Nik
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
guy
Top achievements
Rank 1
answered on 25 Sep 2012, 06:14 AM
yes , and with out the Template  it's working fine


Tags
DragAndDrop
Asked by
guy
Top achievements
Rank 1
Answers by
Nick
Telerik team
guy
Top achievements
Rank 1
Share this question
or