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. Image for the cookie policy date

Set background of ResourceView (NOT the items)

Is it possible to set the background color of the ResourceView in SfSchedule? (Not the items themselves - the container that holds the resources for the scheduler.)

4 Replies

EP Elias P December 17, 2019 12:09 AM UTC

I have found the following (at least on Xamarin Forms - Android):
- Setting the Header background color shows the correct color in the previewer, but not during runtime
- To change the ResourceContainer's background color, I had to write a DependencyService that uses reflection to set the background. Relevant code below.

    public class Hack : IHack
        public void Hack(SfSchedule schedule)
            var nativeObject = typeof(SfSchedule).GetProperty("NativeObject", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(schedule);
            var androidObject = nativeObject as Com.Syncfusion.Schedule.SfSchedule;

            var resourceContainer = androidObject.GetType().GetProperty("ResourceContainer", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).GetValue(androidObject) as Android.Widget.FrameLayout;



IR Indumathi Ravichandran Syncfusion Team December 17, 2019 12:54 PM UTC

Hi Elias, 
Thank you for contacting Syncfusion support. 
Currently, we are analyzing your requirement of “Applying BackgroundColor for ResourceView Container” Xamarin.Forms. We will validate and update you the further details within two business days (December 19, 2019). We appreciate your patience until then. 
Indumathi R  

KA Karthikraja Arumugam Syncfusion Team December 19, 2019 12:59 PM UTC

Hi Elias, 
Thank you for your patience. 
We have checked your requirement of “Changing resource view container background color”. As of now, schedule doesn’t have direct support to change resource view container color, so we have logged an issue report for the same. After this fix, you can change container background color by changing Schedule background color. We will fix this and include the issue fix in our Weekly Nuget release which is expected to roll out on January 7, 2019. We appreciate your patience until then. 
Karthik Raja A 

KA Karthikraja Arumugam Syncfusion Team January 7, 2020 11:17 AM UTC

Hi Elias,                    
We have provided support to change “Resource view container background color” by changing the schedule background color and included the fix in our latest Weekly NuGet release update version which is available for download (nuget.org).

As we have already mentioned you can change resource view container color by setting schedule background color property. Please refer the following code example for the same, 
schedule.BackgroundColor = Color.Cyan; 
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance. 
Karthik Raja A 

Live Chat Icon For mobile
Up arrow icon