Drag and Drop with Scheduler again

2 posts, 0 answers
  1. Khai Zam
    Khai Zam avatar
    1 posts
    Member since:
    Nov 2009

    Posted 04 Dec 2009 Link to this post

    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)
                        new Appointment()
                            Start = timeSlotItem.TimeSlot.Start,
                            End = timeSlotItem.TimeSlot.End,
                            Subject = sourceListBoxItem.FindChildByType<TextBlock>().Text

            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.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...

  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 08 Dec 2009 Link to this post

    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.

    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.
  3. DevCraft banner
Back to Top