Hey Guys,
Looking for some guidance here about drag and drop onto a ultradayview.
i have a list view with people’s names on it and i want to be able to drag from the list view and drop onto the ultradayview and it creates the entry/appointment for that person where i have dropped it.
I have setup the events for the listview for drag enter and have been able to create the event for dragdrop for the ultradayview, but i can not work out how to work out where i have dropped it and how to create the appointment for it
Thanks in advance for any help or guidance you can offer
Cheers Phil
Hi,
I am facing problem while drag and drop appointment from one owner to other.
I have used WinMisc >UltraTilePanel from infragestic’s sample, in that I could not able to get dropping’s owner name or owner’s timeslot.
I have tried ‘this.dvSchedule.GetOwnerFromPoint(e.X, e.Y);’ but it doesn’t working.
Probably I need to know the owner where I am dropping appointment.
Thanks in advance for any help or guidance you can offer.
Hey,
There is actually some pretty neat methods off of the DayView conrol that make this process very simple. There is a GetTimeSlotFromPoint method which takes the point where you did the drop which you have within the DragDrop event. Then there is a GetVisibleDayFromPoint to get the day from the point at which we dropped. Then we can use this information to create an appointment and add it to the DayView. Here is a code snippet. I have also attached a project created with NetAdvantage 2008 Vol.2 and VS2008. Hope this helps.
private void ultraDayView1_DragDrop(object sender, DragEventArgs e)
Point clientPoint = this.ultraDayView1.PointToClient(Form1.MousePosition);
{
Appointment appt = new Appointment(new DateTime(vday.Date.Year, vday.Date.Month, vday.Date.Day, tslot.StartTime.Hour, tslot.StartTime.Minute, tslot.StartTime.Second),
appt.Subject = ((ListViewItem)e.Data.GetData(typeof(ListViewItem))).Text;
}
else