public PanelAssociation(DateTime Date)
{
date = Date;
InitializeComponent();
Day.Text = date.ToShortDateString();
DragDropManager.AddDropHandler(ListExtern, OnDrop);
DragDropManager.AddDragOverHandler(ListExtern, OnDragOver);
}
private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
var draggedItem = ((DataObject)e.Data).GetData("DragData");
var droppedItem = (e.OriginalSource as FrameworkElement).ParentOfType<
RadTreeViewItem
>();
PeopleModel.PeopleDetail people = draggedItem as PeopleModel.PeopleDetail;
OrderModel.OrderHead head = droppedItem.Item as OrderModel.OrderHead;
//create program
OrderModel.OrderService.CreateProgramByID(head, date, people.id);
}
private void OnDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
var draggedItem = DragDropPayloadManager.GetDataFromObject(e.Data, "DragData");
var droppedItem = (e.OriginalSource as FrameworkElement).ParentOfType<
RadTreeViewItem
>();
//remove all selections
(sender as RadTreeView).SelectedItem = null;
//select just droppeditem
if (draggedItem is PeopleModel.PeopleDetail)
{
droppedItem.IsSelected = true;
}
else
{
e.Effects = DragDropEffects.None;
}
e.Handled = true;
}
DragEventArgs.cs not found
i post my code: