iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi
Using the ScheduleView control and displaying the calendar for the month, I want to know the day the user clicks on. How do I work that out?
Thanks
Damien
Hello,Thank you for the question regarding UXScheduleView.Currently there is no such as SelectedItem property in UXScheduleView.
I apologize for the inconvenience.Meanwhile you could this example work around below for this scenario.Based on your information I try to modify one of UXScheduleView samples from ClientUI Control Solution Samples, Month View page.The following steps are how I implement the example work around:1. In “MonthViewViewModel.cs” page (under Intersoft.ClientUI.Samples.UXScheduleView -> ViewModels folder), I create a “MyCalendar” object.
private DateTime _myCalendar; public DateTime MyCalendar { get { return _myCalendar; } set { if (_myCalendar != null) { _myCalendar = value; OnPropertyChanged("MyCalendar"); } } }
2. Then in “Default.xaml.cs” page (under Intersoft.ClientUI.Samples.UXScheduleView -> Views -> MonthView folder), I add / create a new event handler that similar with “SelectedItem Property”, in this work around I use “MouseLeftButtonDown” event.
public Default() { InitializeComponent(); // Add new event handler SampleControl1.MouseLeftButtonDown = new MouseButtonEventHandler(SampleControl1_MouseLeftButtonDown); }
3. In then “MouseLeftButtonDown” event (in Default.xaml.cs), I try to get the selected MonthViewCell object using this code below:
// Get the MonthViewCell object UXScheduleMonthViewCell monthViewCell = Intersoft.Client.Framework.Utility.FindVisualAncestor(e.OriginalSource as DependencyObject, typeof(UXScheduleMonthViewCell)) as UXScheduleMonthViewCell;
4. After that I try to get the ViewModel of this as well.
// Get the ViewModel of this view MonthViewViewModel vm = monthViewCell.DataContext as MonthViewViewModel;
5. The last step is I set the “MyCalendar” object with DisplayDate value from MonthViewViewModel.
vm.MyCalendar=monthViewCell.DisplayDate;
Please kindly have review on the attached file to see result.Hope this helps.Regards,Hans K.
Works a treat!
Thanks Hans
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname