private void calendarPlanner1_ItemClick(object sender, WeekPlannerItemEventArgs e)
{
DoDragDrop(calendarPlanner1.SelectedItem, DragDropEffects.Move);
}
private void calendarPlanner1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void calendarPlanner1_DragDrop(object sender, DragEventArgs e)
{
SRRepair repairDrag = new SRRepair();
var rows = calendarPlanner1.Rows;
var row = rows.ElementAt(calendarPlanner1.SelectedRowIndex);
row.Items.Add((WeekPlannerItem)e.Data.GetData(typeof(WeekPlannerItem)));
repairDrag = assignedRepairsList[assignedItemCollection.IndexOf(calendarPlanner1.SelectedItem)];
repairDrag.AssignedToUser = engineerList[calendarPlanner1.SelectedRowIndex];
repairDrag.Update();
}
The code above is what I have so far for drag and drop operation. It works ok until the third (drag drop) method. Basically what im trying to achieve is to drag an item between the names. I could get the index where I drag the item from using 'calendar.SelectedRowIndex' but the problem is getting the index of the destination or where i want to drag it to. Allows me to drag items but when i let go of the left button in the mouse it goes back where it came from. The calendar is an open source and i found it from codeproject and i am using and modifying it to add it in an existing desktop application.
Is there anyway or an event I could use to get the position of the mouse as soon I release the left button in the mouse?