BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
ListBox | Schedule | |
Math ---> Dragged | Math 9:00 - 12:00 | |
Hi Jethro,
As of now we don’t have any support to drag items from data grid or list view in schedule control
Regards
Vigneshkumar R.
private void listSubjects_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ListBox parent = (ListBox)sender; dragSource = parent; object data = GetDataFromListBox(dragSource, e.GetPosition(parent)); if (data != null) { DragDrop.DoDragDrop(parent, data, DragDropEffects.Move); } } |
private static object GetDataFromListBox(ListBox source, Point point) { UIElement element = source.InputHitTest(point) as UIElement; if (element != null) { object data = DependencyProperty.UnsetValue; while (data == DependencyProperty.UnsetValue) { data = source.ItemContainerGenerator.ItemFromContainer(element); if (data == DependencyProperty.UnsetValue) { element = VisualTreeHelper.GetParent(element) as UIElement; } if (element == source) { return null; } } if (data != DependencyProperty.UnsetValue) { return data; } } return null; } |
private void Schedule_Drop(object sender, DragEventArgs e) { SfSchedule parent = (SfSchedule)sender; object data = e.Data.GetData(typeof(string)); AppointmentCollection.Add(new ScheduleAppointment() { StartTime = Convert.ToDateTime("13:00"), EndTime = Convert.ToDateTime("16:00"), Subject = data.ToString() }); Schedule.Appointments = AppointmentCollection; listSubjects.Items.Remove(data); } |
Hi Jethro
We have implemented the similar requirement in the schedule WinRT platform. In WinRT SfScehdule, we place the dragged item where we have dropped. Please refer to the following KB article.
KB Link: http://www.syncfusion.com/kb/2854/how-to-do-a-draganddrop-of-listview-items-into-sfschedule-control
Also, we have implementing this requirement in the Schedule wpf platform which will be available in upcoming service pack release at the end of November.
Regards
Vigneshkumar R