This is a migrated thread and some comments may be shown as answers.

Drag and Drop with Scheduler again

1 Answer 55 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Khai Zam
Top achievements
Rank 1
Khai Zam asked on 05 Dec 2009, 05:24 AM
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...








1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 08 Dec 2009, 06:46 PM
Hi Khai Zam,

Thank you for contacting us. You can find attached the project converted to VB. You can download and test it.

You can also use our converter, when you need to convert C# to VB code or vice versa.

Regards,
Konstantina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DragAndDrop
Asked by
Khai Zam
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or