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

ResourceType not allowing multiple values when using provider

3 Answers 83 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
WG
Top achievements
Rank 1
WG asked on 13 Aug 2010, 03:31 AM
I'm testing the RadScheduler in an MVC app using a custom provider.  When setting resource types, I use the following code:

public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner) {
    List<ResourceType> resourceTypes = new List<ResourceType>();
    resourceTypes.Add(new ResourceType("Staff", false));
    resourceTypes.Add(new ResourceType("Client", true));
    return resourceTypes;
}

However, when adding/editing appointments in the Scheduler, both Client and Staff resource lists show up as a single-choice dropdown, rather than the multi-choice checkboxes expected for the Client type.

If I specify the ResourceTypes at design-time using the Resource Type Editor, the Client resources are displayed correctly with checkboxes.  This is a tolerable solution, but it defeats the purpose of specifying ResourceTypes from the provider, and seems to contradict the information in the help file saying that the Scheduler gets its information from the data provider.

I've also looked at the article telling how to create a provider that supports multiple resource values, but that article is out of date as the provider property 'SupportsMultipleResourceValues' is now listed as obsolete.

Is the Scheduler supposed to use ResourceTypes as specified by the provider, or is using the Resource Type Editor the only way to allow for multiple resource selection?

Thanks

3 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 13 Aug 2010, 03:51 PM
Hello WG,

Thank you for your feedback.

We have just updated the article which you have seen as per your suggestion. Basically, the old approach relies that the provider itself should determine if a resource type is multivalued or not. Now, the control is handed directly in your RadScheduler declaration and you can use the control's DataBound event to specify the AllowMultipleValues property:

protected void RadScheduler1_DataBound(object sender, EventArgs e)
       {
           RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = true;
           //RadScheduler1.ResourceTypes.FindByName("Room").AllowMultipleValues = false;
       }

Please, see the Multiple Resource Values for reference.


Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
WG
Top achievements
Rank 1
answered on 14 Aug 2010, 02:04 AM
Peter,

thanks for the response. 

While I am able to get the Scheduler to work for me, it still seems like there's something a bit buggy when I set AllowMultipleValues = true  on a ResourceType in my provider, and then need to find the same ResourceType after it has been loaded into the Scheduler and again set AllowMultipleValues = true.  Since the Scheduler is retrieving ResourceTypes from the provider, shouldn't it preserve the property values as set in the provider?
0
Peter
Telerik team
answered on 18 Aug 2010, 03:14 PM

Sorry for not being clearer. What I meant was that the AllowMultipleValues should not be set in the provider. The update of the article consists basically in that we have deleted all references to the 'SupportsMultipleResourceValues' property.


All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
WG
Top achievements
Rank 1
Answers by
Peter
Telerik team
WG
Top achievements
Rank 1
Share this question
or