Can you please provide information how drag and drop will work for scheudlerView? I see your online demo and tried to understand the logic from code.But I am not able to understand.
EffectivePixelLength, EffectiveOrientation, BehaviorProperty, AppointmentTemplateProperty are used for which purpose?
"BehaviorBase" class is used for what ?
In scheduler AppointmentEditing event I have done following code and I can cancel the edit Popup.
How can I do it for scheudlerView?
I am not able to get AppointmentEditAction for schedulerView.
if (e.AppointmentEditAction == AppointmentEditAction.Resize)
{
e.Cancel = true;
}
if (e.AppointmentEditAction != AppointmentEditAction.Drag && e.AppointmentEditAction != AppointmentEditAction.Resize)
{
e.Cancel = true;
}
If you provide any example for drag and drop than its good for me.
Thanks
Hardik Pancholi
19 Answers, 1 is accepted
In order to implement a custom drag and drop behavior, I would suggest you to inherit the DefaultDragDropBehavior and set it RadScheduleView.DragDropBehavior. Please, refer to:
- our online documentation - http://www.telerik.com/help/silverlight/radscheduleview-features-draganddrop.html
- our online example - http://demos.telerik.com/silverlight/#ScheduleView/FirstLook
George
the Telerik team
I need to use AppointmentEditAction too.
For example :
If (e.AppointmentEditAction != AppointmentEditAction.Resize)
doesn't work with scheduleView.
Is there any way to use AppointmentEditAction with scheduleView ?
In scheudlerView there isn't anything like AppoitnementEditAction. You have to use CustomDragAndDrop class for re-size and drag & drop.
Thanks
Hardik
SE
Regards
Kjell Erik
Best wishes,
Valeri Hristov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
I'm basically using your demo code from the first look example, except changing it to DefaultDragDropBehavior instead of ScheduleViewDragDropBehavior.
The problem I'm seeing is that when I examine the slots I'm dragging over in this class, they aren't marked as IsReadOnly. They also are just Slots and not my CustomSlot class.
Is this due to using the Default instead of ScheduleView behavior? Is this something I can fix with the Default version, or do I need to hold off until I'm able to use the ScheduleViewDragDropBehavior class? I'm guessing it is working correctly in ScheduleViewDragDropBehavior.
Thanks!
The DestinationSlots collection contains new Slot instances that represent the slots where the dragged appointments will be dropped if the user releases the mouse button. Probably if you describe what you are trying to achieve I should be able to provide more adequate advice?
Greetings,
Valeri Hristov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
When I turn off the custom DragDrop behavior, it works like it's supposed to. I drag an appointment over a readonly slot and it won't let me drop it, but when I use the custom behavior (code directly from your demo site) it allows me to drop over a readonly slot. So I looked at the slots in the DestinationSlots collection and none of them are readonly even when they should be.
I'm not trying to do anything really special, just use a custom dragdrop like you have in your First Look in combination with the ReadOnly special slots demo. I haven't even customized it to my needs yet.
I understand now. The read-only checking is not publicly available yet. Since the base implementation of the CanDrop method only checks whether any of the DestinationSlots are overlapping with a read-only Slot and returns false in this case, you could call it in your CanDrop method:
public override bool CanDrop(DragDropState state)
{
return base.CanDrop(state) || /*your custom logic here*/;
}
Best wishes,
Valeri Hristov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
I was hoping I was just doing something wrong and your first answer would answer this one...that isn't the case.
Is this also something that isn't supported now?
The slots in the two collections are not supposed to be the same, e.g. you should not expect the DestinationSlots collection to contain any of the objects in the SpecialSlots collection.
Greetings,
Valeri Hristov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
If that's the case, then I'll have to wait for the user to drop it and handle the logic elsewhere.
Greetings,
Valeri Hristov
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Our use case is the ability to "Reserve" timeslots for certain types of appointments. Only an appointment with certain properties can be placed over a reservation. So when the user does a drag and drop and can't drop on that reservation, I want it to act like a Read Only slot does. A use case that is probably more universal is that only certain appointment categories can be placed in "Non-working hours".
Although the new ScheduleView implementation of SpecialSlots is much much better than what I had to do in Scheduler, it is missing some very important things. This is one of them. Another is the ability to have a tool tip for SpecialSlots (another unanswered thread on the board). I also will need to handle a right-click context menu that will change whether it's on SpecialSlots or not, but I haven't gotten to that to see if there is an issue there (I'm betting there is).
Thank you for the feedback. Your use case is very good and we will definitely have it in mind when extending the "special slots" functionality of RadScheduleView.
Best wishes,
Valeri Hristov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Basically, in the ConflictCheckingDragDropBehavior class, I can access the special slots using this code to get the ScheduleView:
RadScheduleView scheduleViewControl = (RadScheduleView)state.ServiceProvider.GetService<
IDialogProvider
>();
It still would be cleaner to know if the slot is a special slot or read only slot without having to use the service provider, but for now, this will work for me. Hopefully others can use this also.
RadScheduleView DragDrop inside RadPanelBar is not working.
It is firing CanStartDrag and CanDrop event never fires.
Here is the code.
<telerik:RadPanelBar x:Name="radPanelBar1" IsTextSearchEnabled="False" VerticalAlignment="Stretch" Margin="0" d:LayoutOverrides="VerticalAlignment" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<telerik:RadPanelBarItem x:Name="Calendar"
HorizontalAlignment="Stretch">
<telerik:RadPanelBarItem.Header>
<StackPanel Orientation="Horizontal">
</StackPanel>
</telerik:RadPanelBarItem.Header>
<Grid Background="White">
<scheduleView:RadScheduleView x:Name="scheduler" ActiveViewDefinitionIndex="2" telerik:StyleManager.Theme="Windows7" FontSize="9" FontFamily="Arial" >
<scheduleView:RadScheduleView.ViewDefinitions>
<scheduleView:DayViewDefinition ShowAllDayArea="True" ShowWeekGroupHeaders="True" />
<scheduleView:WeekViewDefinition ShowAllDayArea="True" ShowWeekGroupHeaders="True"/>
<scheduleView:MonthViewDefinition VisibleDays="30" />
</scheduleView:RadScheduleView.ViewDefinitions>
<telerik:RadScheduleView.DragDropBehavior>
<Calendar:CustomDragDropBehavior></Calendar:CustomDragDropBehavior>
</telerik:RadScheduleView.DragDropBehavior>
</scheduleView:RadScheduleView>
</Grid>
</telerik:RadPanelBarItem>
</telerik:RadPanelBar>
public class CustomDragDropBehavior : ScheduleViewDragDropBehavior
{
public override bool CanDrop(DragDropState state)
{
return true;
}
public override bool CanStartDrag(DragDropState state)
{
return true;
}
public override void Drop(DragDropState state)
{
base.Drop(state);
}
}
We are aware of this problem and we will do our best to solve the issue for the future versions of the controls. Meanwhile I suggest you set the ExecutionMode of the RadDragAndDropManager to
DragExecutionMode.Disabled
in order to workaround the problem.Example:
RadDragAndDropManager.ExecutionMode = DragExecutionMode.Disabled;
InitializeComponent();
!Note that the code is executed before
InitializeComponent
().Kind regards,
Rosi
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thank you for your response.
Its working fine now.
Thanks,
Kotte.