This is a migrated thread and some comments may be shown as answers.

Custom Provider ... no resources .. how to?

1 Answer 70 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 27 Aug 2008, 07:06 PM
Hello,

I've implemented a custom DB provider (based on the sample provided in the live demos), but I'm having a bit of a problem.

I don't have any custom resources. Why would I make a custom provider with no resources you ask? Because in the future I will have resources, but not at the moment. So I went ahead and built my provider, so that when the time comes to add resources, it'll be a relatively painless task. Now on to my problem:

I get the following error when trying to view the scheduler:

[NullReferenceException: Object reference not set to an instance of an object.] 
   Telerik.Web.UI.RadScheduler.BindResourcesFromProvider(IEnumerable`1 providedResourceTypes) +114 
   Telerik.Web.UI.RadScheduler.PerformSelect() +113 
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 
   Telerik.Web.UI.RadScheduler.EnsureDataBound() +48 
   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +55 
   Telerik.Web.UI.RadScheduler.CreateChildControls() +10 
   System.Web.UI.Control.EnsureChildControls() +87 
   System.Web.UI.Control.PreRenderRecursiveInternal() +50 
   System.Web.UI.Control.PreRenderRecursiveInternal() +170 
   System.Web.UI.Control.PreRenderRecursiveInternal() +170 
   System.Web.UI.Control.PreRenderRecursiveInternal() +170 
   System.Web.UI.Control.PreRenderRecursiveInternal() +170 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041 
 


So, what should I do to fix this. Currently, my provider has the following overloads to handle resources (again, of which I have none):

    Public Overloads Overrides Function GetResourceTypes(ByVal owner As RadScheduler) As IEnumerable(Of ResourceType) 
        Dim resourceTypes As ResourceType() = New ResourceType(0) {} 
 
        Return resourceTypes 
    End Function 
 
    Public Overloads Overrides Function GetResourcesByType(ByVal owner As RadScheduler, ByVal resourceType As StringAs IEnumerable(Of Resource) 
        Return New List(Of Resource)() 
    End Function 

1 Answer, 1 is accepted

Sort by
0
Brad
Top achievements
Rank 1
answered on 27 Aug 2008, 07:30 PM
nevermind. Fixed it ...

both functions should be:

return Nothing
Tags
Scheduler
Asked by
Brad
Top achievements
Rank 1
Answers by
Brad
Top achievements
Rank 1
Share this question
or