Can anyone would be kindly enough to post the Drag-n-drop to Scheduler codes in VB.NET ? most of the samples are in C# . I cannot get my sample to work since i am having trouble converting the codes like below:
private void OnDropInfo(object sender, DragDropEventArgs e)
{
var sourceListBoxItem = e.Options.Source as System.Windows.Controls.ListBoxItem;
var timeSlotItem = e.Options.Destination as TimeSlotItem;
if (e.Options.Status == DragStatus.DropComplete && timeSlotItem != null)
{
this.Scheduler.Appointments.Add(
new Appointment()
{
Start = timeSlotItem.TimeSlot.Start,
End = timeSlotItem.TimeSlot.End,
Subject = sourceListBoxItem.FindChildByType<TextBlock>().Text
}
);
this.source.Remove(sourceListBoxItem.Content.ToString());
}
}
private void InitializeTimeSlotItems()
{
this.timeSlotItems = this.Scheduler.ChildrenOfType<TimeSlotItem>();
foreach (TimeSlotItem item in this.timeSlotItems)
{
item.SetValue(RadDragAndDropManager.AllowDropProperty, true);
}
}
and also this one:
Public Sub New()
Me.InitializeComponent()
Me.Scheduler.Loaded += Me.Scheduler_Loaded
Me.Scheduler.ActiveViewDefinitionChanged += Me.Scheduler_ActiveViewDefinitionChanged
Me.Scheduler.LayoutUpdated += Me.Scheduler_LayoutUpdated
Me.Scheduler.View.PropertyChanged += Me.OnSchedulerViewPropertyChanged
RadDragAndDropManager.AddDragQueryHandler(Me, OnDragQuery)
RadDragAndDropManager.AddDropQueryHandler(Me, OnDropQuery)
RadDragAndDropManager.AddDropInfoHandler(Me, OnDropInfo)
Me.listBox.ItemsSource = Me.source
End Sub
I am trying to drag n drop an itemtemplate like in the Telerik First Look to the scheduler. I am still new to Silverlight sorry for the troubles. Thanks in advance...
private void OnDropInfo(object sender, DragDropEventArgs e)
{
var sourceListBoxItem = e.Options.Source as System.Windows.Controls.ListBoxItem;
var timeSlotItem = e.Options.Destination as TimeSlotItem;
if (e.Options.Status == DragStatus.DropComplete && timeSlotItem != null)
{
this.Scheduler.Appointments.Add(
new Appointment()
{
Start = timeSlotItem.TimeSlot.Start,
End = timeSlotItem.TimeSlot.End,
Subject = sourceListBoxItem.FindChildByType<TextBlock>().Text
}
);
this.source.Remove(sourceListBoxItem.Content.ToString());
}
}
private void InitializeTimeSlotItems()
{
this.timeSlotItems = this.Scheduler.ChildrenOfType<TimeSlotItem>();
foreach (TimeSlotItem item in this.timeSlotItems)
{
item.SetValue(RadDragAndDropManager.AllowDropProperty, true);
}
}
and also this one:
Public Sub New()
Me.InitializeComponent()
Me.Scheduler.Loaded += Me.Scheduler_Loaded
Me.Scheduler.ActiveViewDefinitionChanged += Me.Scheduler_ActiveViewDefinitionChanged
Me.Scheduler.LayoutUpdated += Me.Scheduler_LayoutUpdated
Me.Scheduler.View.PropertyChanged += Me.OnSchedulerViewPropertyChanged
RadDragAndDropManager.AddDragQueryHandler(Me, OnDragQuery)
RadDragAndDropManager.AddDropQueryHandler(Me, OnDropQuery)
RadDragAndDropManager.AddDropInfoHandler(Me, OnDropInfo)
Me.listBox.ItemsSource = Me.source
End Sub
I am trying to drag n drop an itemtemplate like in the Telerik First Look to the scheduler. I am still new to Silverlight sorry for the troubles. Thanks in advance...