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

Scheduler to ScheduleView troubles

3 Answers 36 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Jesus
Top achievements
Rank 1
Jesus asked on 25 Apr 2013, 07:22 PM
Hi there...

I´m changing to ScheduleView and I have some points unsolved, Here some .....

1.-  I´d like change the width of the TimeRuler, I can´t do that.
2.- I´d like ask confirmation in the Drag&drop action, I´ve tryied use an MessageBox in DragDropCompleted. event.. but doesn´t work fine

     public override void DragDropCompleted(Telerik.Windows.Controls.DragDropState state)
        {
            foreach (Appointment sp in state.DraggedAppointments)
            {
                MessageBox.Show("El evento \""+sp.Subject+"\" se ha movido a "+state.Appointment.Start, "",MessageBoxButton.OKCancel);
                break;
            }                                    
        }        
I´d like able to Commit or Rollover a Drag&Drop operation as a result of the confirmation alert window .

3.- In RadScheduler, there was a property called SelectedResource, which access to info to the Resource you have selected.
Seems that ScheduleView doesn´t have it. How can I access to the resource info of a slot selected.?

ej.    scheduler.SelectedResource.DisplayName;


Txs in advance,,,
Saludos.

3 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 30 Apr 2013, 01:36 PM
Hi Jesus,

1. Could you please send us a screenshot showing exactly the requirement? Thanks
2. You should customize the ScheduleView DragDropBehavior in order to show a confirmation window, I will explain the steps in details:

  •   Create a class that inherits from ScheduleViewDragDropBehavior and override its Drop method:
public class CustomDragDropBehavior : ScheduleViewDragDropBehavior
{
    public override void Drop(DragDropState state)
    {
        base.Drop(state);
    }
}

  • Add a private DragDropState property to the class and also remove calling base.Drop(state) in the Drop method and add code for calling a confirmation window. Additionally, you should add a Closed event:

public class CustomDragDropBehavior : ScheduleViewDragDropBehavior
{
    private DragDropState _currentState;
 
    public override void Drop(DragDropState state)
    {      
        _currentState = state;
 
        var dialogParams = new DialogParameters()
        {
            OkButtonContent = "Move",
            CancelButtonContent = "Cancel",
            Content = "Confirm that you want to move the appointment",
            Closed = this.OnClosed
        };
        RadWindow.Confirm(dialogParams);
    }
 
    private void OnClosed(object sender, WindowClosedEventArgs e)
    {
        if (e.DialogResult == true)
            base.Drop(_currentState);
        _currentState = null;
    }
}

  • Finally set the newly created class to the ScheduleView DragDropbehavior property:
<telerik:RadScheduleView ...>
    ...
 
    <telerik:RadScheduleView.DragDropBehavior>
        <local:CustomDragDropBehavior  />
    </telerik:RadScheduleView.DragDropBehavior>
</telerik:RadScheduleView>

where "local" is the namespace in your application.

3. You can use SelectedSlot property of the ScheduleView and check its Resources property,

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jesus
Top achievements
Rank 1
answered on 30 Apr 2013, 06:48 PM
Thanks Yana...

The Drop event works very fine for me....
And the SelectedSlot...

In the first point I refer to the space (width) that ScheduleView takes to show a day in Week Definition. I like to make it smaller
in order to NOT SHOW the scrollbar.....

Txs.
0
Yana
Telerik team
answered on 07 May 2013, 08:48 AM
Hello Jesus,

Thank you for the clarification.

The widths of the group headers in RadScheduleView depend on a few things:

 -the count of the intersecting appointments in each group. The effect of this can be minimized by setting the MinAppointmentWidth property to 1;
- the desired width of the GroupHeader control itself. It can be changed by either setting a custom GroupHeaderStyle or a GroupHeaderTemplate.
- whether the groups are stretched or not. This featured is switched on and off by setting the StretchGroupHeaders property of the view definitions. If it is switched on and there is extra space left, it is distributed among the groups.

I hope this helps.

Regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
Jesus
Top achievements
Rank 1
Answers by
Yana
Telerik team
Jesus
Top achievements
Rank 1
Share this question
or