We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selected style for custom appointment template

Thread ID:

Created:

Updated:

Platform:

Replies:

145787 Jul 8,2019 06:53 PM UTC Jul 11,2019 07:18 AM UTC Xamarin.Forms 5
loading
Tags: SfSchedule
Emanuel
Asked On July 8, 2019 06:53 PM UTC

Hi, I created custom AppointmentTemplate on Schedule for DayView.
How to set a SelectionBorder using AppointmentTemplate?

I try set a SelectStyle but this work only I selected an empty slot. For existing appointment not work.

<syncfusion:SfSchedule.SelectionStyle>
     <syncfusion:SelectionStyle 
               BackgroundColor="Gray" 
               BorderColor="Black"
               BorderThickness="2"
               BorderCornerRadius="5">
     </syncfusion:SelectionStyle>
</syncfusion:SfSchedule.SelectionStyle>
  

Thank you

Emanuel

Subburaj Pandian Veluchamy [Syncfusion]
Replied On July 9, 2019 10:54 AM UTC

Hi Emanuel, 
  
Thank you for contacting Syncfusion support. 
  
Based on the shared information, your requirement of “Applying SelectionBorder for AppointmentTemplate using Schedule SelectionStyle” is not possible. Since you are using AppointmentTemplate, selection style will not be applied to the appointment view. AppointmentTemplate is user defined, you are providing your own custom view for the appointment so if you want selection border you need to provide border color for your own view on appointment view selected. Schedule Style will apply only for the Schedule appointment and not in the custom UI. 
 
You can refer our User Guide documentation for the same, 
 
We hope this helps. Please let us know if you would require any further assistance. 
 
Regards,
Subburaj Pandian V     


Emanuel
Replied On July 9, 2019 01:27 PM UTC

Hi Subburaj Pandian,
thank you for the feedback.

I had alreasy seen the link that you the link you gave me but I couldn't set the border for the selection using custom AppointmentTemplate.
I had seen the syncfusion examples for the schedule but I did not find similar examples with AppointmentTemplate.

Can you give me an example that does what I need?

Thanks

Regards,
Emanuel

Subburaj Pandian Veluchamy [Syncfusion]
Replied On July 10, 2019 11:56 AM UTC

Hi Emanuel, 
  
Thank you for the update. 
  
AppointmentTemplate view is given by the user so whatever customization can be made on that view. We have prepared a sample to change selection style of AppointmentTemplate on appointment has been selected. On selecting an appointment existing selection should be cleared. 
 
Please refer the following code, 
  
[C#]  
private void Button_Clicked(object sender, EventArgs e) 
{ 
     var button = sender as Button; 
  
     //Storing selected appointment view to clear selection on next selection 
     if (!customViews.Contains(button)) 
         customViews.Add(button); 
  
      //Clears existing selected cell 
      schedule.SelectedDate = null; 
  
      //Clears existing selected appointment 
      this.ClearSelection(); 
  
      //Change Background color of selected appointment 
      var parentView = button.Parent as Grid; 
      if (parentView.BackgroundColor == Color.YellowGreen) 
          parentView.BackgroundColor = Color.Black; 
      else 
          parentView.BackgroundColor = Color.YellowGreen; 
} 
  
private void ClearSelection() 
{ 
      var previousSelectedView = customViews.FirstOrDefault(x => (x.Parent as Grid).BackgroundColor == Color.Black); 
      if(previousSelectedView != null) 
                (previousSelectedView.Parent as Grid).BackgroundColor = Color.YellowGreen; 
} 
  
Sample link: Schedule 
 
Note: In our sample we have used Button inside Grid as custom appointment view and handled style on button clicked event. 
  
We hope this helps. Kindly revert us if you have any concern. 
  
Regards,
Subburaj Pandian V
    


Emanuel
Replied On July 10, 2019 03:33 PM UTC

Hi Subburaj Pandian,
Thank you for the example and for your support.

Regards,
Emanuel

Subburaj Pandian Veluchamy [Syncfusion]
Replied On July 11, 2019 07:18 AM UTC

Hi Emanuel,  
   
Thank you for the update.  
 
Please let us know, if you would require any further assistance. As always, we will be happy to assist you. 
  
Regards,
Subburaj Pandian V  
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon