6 Answers, 1 is accepted
0
Hello,
RadScheduleView doesn't provide such an event. Could you please give us more details about your scenario and why you need this Slot selection changed event? Thanks
All the best,
Yana
the Telerik team
RadScheduleView doesn't provide such an event. Could you please give us more details about your scenario and why you need this Slot selection changed event? Thanks
All the best,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
TEC
Top achievements
Rank 2
answered on 10 Aug 2011, 10:09 AM
Hi,
My scenario is that I want to propose a list of appointments to the user when a slot is selected? The proposal of appointments has to be calculated server side, so I need a hook (event) for the slot selection change to send a command to the server. I hope this is clear enough.
Kind regards.
My scenario is that I want to propose a list of appointments to the user when a slot is selected? The proposal of appointments has to be calculated server side, so I need a hook (event) for the slot selection change to send a command to the server. I hope this is clear enough.
Kind regards.
0
Hello Tec,
You can bind SelectedSlot property of the ScheduleView to a property in your ViewModel like this:
and the ViewModel:
Try it and let us know how it goes.
Regards,
Yana
the Telerik team
You can bind SelectedSlot property of the ScheduleView to a property in your ViewModel like this:
<
telerik:RadScheduleView
x:Name
=
"schedule"
SelectedSlot
=
"{Binding SelectedSlot, Mode=TwoWay}"
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:MonthViewDefinition
/>
</
telerik:RadScheduleView.ViewDefinitions
>
...
</
telerik:RadScheduleView
>
and the ViewModel:
public
class
MyViewModel : ViewModelBase
{
private
Slot selectedSlot;
public
Slot SelectedSlot
{
set
{
if
(selectedSlot != value)
{
selectedSlot = value;
this
.OnPropertyChanged(
"SelectedSlot"
);
}
}
get
{
return
selectedSlot;
}
}
}
Try it and let us know how it goes.
Regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
TEC
Top achievements
Rank 2
answered on 19 Aug 2011, 11:04 PM
Hi,
I did not do it exactly as you suggested, but I did get it working for me with a binding on the "SelectedSlot" property. As follows:
......
Thanks for the help.
Kind regards
I did not do it exactly as you suggested, but I did get it working for me with a binding on the "SelectedSlot" property. As follows:
......
Binding bSelectedSlot = new Binding(); bSelectedSlot.Source = myRadScheduleView; bSelectedSlot.Mode = BindingMode.TwoWay; bSelectedSlot.Path = new PropertyPath("SelectedSlot"); bSelectedSlot.Converter = new SlotSelectionConverter(SlotSelectionChanged); myRadScheduleView.SetBinding(RadScheduleView.SelectedSlotProperty, bSelectedSlot);.....
private void SlotSelectionChanged(Slot slot) { ...... }
public delegate void ProcessSlotDelegate(Slot slot); public class SlotSelectionConverter : IValueConverter { private ProcessSlotDelegate slotSelectionChanged; public SlotSelectionConverter(ProcessSlotDelegate slotSelectionChanged) { this.slotSelectionChanged = slotSelectionChanged; } public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if ((slotSelectionChanged != null) && (value is Slot)) slotSelectionChanged(value as Slot); return value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return value; } }
Thanks for the help.
Kind regards
0
Eric
Top achievements
Rank 1
answered on 23 Aug 2011, 11:28 PM
Sorry...didn't scroll down far enough.
0
Ad
Top achievements
Rank 2
answered on 05 Aug 2015, 02:44 PM
The first suggestion from Yana works great for me out-of-the-box.
Thanks anyway.