Forgetting BackgroundColor in Edit Template

Hi everybody,

   according to your instructions I built a scheduler with individual background colors. After changing data with an Editor Template the original color is not restored because the CategoryColor Property in EventRenderedArgs in the OnEventRendered event is null. See attached sample and video.

   regards

      Uwe

Attachment: Schedule_Forgetting_Background_ab6a2c74.zip

3 Replies 1 reply marked as answer

AK Alagumeena Kalaiselvan Syncfusion Team August 14, 2020 01:40 PM UTC

Hi Uwe, 

Thanks for contacting Syncfusion support. 

We have checked your reported query along with shared sample and issue depicting video. You can overcome this issue by maintaining an input field and bind its value as category color of appointment. Then assign the Category color to the args.Data.CategoryColor argument for OnPopupClose event. Refer the below code for that. 
    <SfSchedule TValue="ScheduleData.AppointmentData" Height="650px" AllowDragAndDrop="true" ShowQuickInfo="true" RowAutoHeight="true" SelectedDate="@(new DateTime(2020, 2, 12))"> 
       ...        
        <ScheduleTemplates> 
            <EditorTemplate> 
                @{  
                    Color = (context as ScheduleData.AppointmentData).CategoryColor; 
                } 
                <input type="hidden" name="color" class="e-field" @bind-value=@Color /> 
         ... 
    </SfSchedule> 
 
@code{ 
    public static string Color { get; set; } = ""; 
    public void OnEditorClose(PopupCloseEventArgs<ScheduleData.AppointmentData> args) 
    { 
        if (args.Data != null && args.Type == PopupType.Editor && RecurrenceEditor != null) 
        { 
            if(args.Data.CategoryColor == null) 
            { 
                args.Data.CategoryColor = Color; 
            } 
            args.Data.RecurrenceRule = RecurrenceEditor.Value != null ? RecurrenceEditor.Value.ToString() : ""; 
        } 
    } 
... 
} 

We have modified the shared sample for your reference which can be get by the below link. 

Please get back to us, if you need further assistance. 

Regards 
Alagumeena.K 


Marked as answer

UH Uwe Hein August 14, 2020 03:12 PM UTC

Hi Alagumeena,

   thank you for your fast answer. This solves my problem.

     regards

       Uwe


VM Vengatesh Maniraj Syncfusion Team August 17, 2020 09:36 AM UTC

Hi Uwe, 

You are most welcome. 

We are happy that our solution has resolved your problem. 

Please get in touch with us if you need any further assistance.  

Regards, 
Vengatesh  


Loader.
Up arrow icon