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
close icon

Resource view image from uri instead of android resource

Is it possible to set the uri i.e. any blob url as image location in the resource viewer implementation for SfScheduler control? My code works well if I use the image from resources (i.e. images added into the drawable folder of Android project) but doesn't work and throw null reference exception when I give blob url in Image string parameter.

Can you pls confirm whether image url will work with resource viewer or not and if yes can you provide the sample/code snippet?

Thanks,

1 Reply

SP Subburaj Pandian Veluchamy Syncfusion Team September 3, 2019 12:11 PM UTC

Hi Krunal, 
  
Thank you for contacting Syncfusion support. 
  
Schedule Resource view implemented from getting images from local files and your requirement of “Load Resource image from URL” can be achieved using custom ResourceItemTemplate view, using which custom view can be provided as Resource display picture and these images can be directly loaded from either database or URL. 
  
[Code Snippet] 
 
schedule.ResourceItemTemplate = new DataTemplate(() => 
{ 
    return new Image 
    { 
        Source = ImageSource.FromUri( new Uri("Image URL")), 
    }; 
}); 
 
  
We have prepared a simple sample for the same, 
 
Sample link: ResourceView 
  
Kindly refer our UG documentation to know more about Resource view customization using DataTemplate and TemplateSelector, 
 
  
We hope this helps. Kindly revert us if you have any concern. 
  
Regards,
Subburaj Pandian V   


Loader.
Live Chat Icon For mobile
Up arrow icon