I can't display a CheckBoxList for multivalued resources

6 posts, 0 answers
  1. Rafael
    Rafael avatar
    3 posts
    Member since:
    Apr 2011

    Posted 25 Apr 2011 Link to this post

    I am using a MVC Project using RadScheduler. My problems begins with the multi-valued resources. I use MultipleResourceValue parameter, but, in the advanced editing form, my resource appears as a DropDownList.

    How can I change the DropDwonList for a CheckBoxList?

    Thanks
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 26 Apr 2011 Link to this post

    Hi Rafael,

    In order to display multi-valued resources in the Advanced Form as a checkboxlist - you need to set the AllowMultipleValues property of the resources to "True" in the RadScheduler's DataBound event handler as shown in this demo:

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

    Please let me know if this was helpful.

    Kind regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Rafael
    Rafael avatar
    3 posts
    Member since:
    Apr 2011

    Posted 26 Apr 2011 Link to this post

    Can I do this without code behind? I use a custom provider and I initialize the AllowMultipleValues to true in GetResource and GetResourceTypes methods . I remember that my proyect is MVC. I use that like in this example: http://www.telerik.com/help/aspnet-ajax/schedule_databindingimplementingaproviderthatsupportsmultivaluedresources.html

    Thanks in advance :)
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 26 Apr 2011 Link to this post

    Hello Rafael,

    As you are using a provider to bind the RadScheduler please make sure that you have set the second parameter of the ResourceType constructor to "true" so that you indicate that the resource will be multi-valued:

    public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
    {
      ResourceType[] resourceTypes = new ResourceType[2];
      resourceTypes[0] = new ResourceType("Teacher", false);
      resourceTypes[1] = new ResourceType("Student", true);
      return resourceTypes;
    }  

    If this still doesn't helps could you please send me your project so I can inspect it and help you?

    Thank you!

    Best Regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Rafael
    Rafael avatar
    3 posts
    Member since:
    Apr 2011

    Posted 26 Apr 2011 Link to this post

    Hello, I uploaded a simple proyect with my problem at http://dl.dropbox.com/u/362745/MultiValueTest.rar , I use a trial Telerik DLL in this example.

    Thanks in advance :)
  6. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 28 Apr 2011 Link to this post

    Hello Rafael,

    Thank you for the attached project.

    It seems that we are having problems with setting the AllowMultipleValues property in the GetResources() method in Providers. We need to investigate this further.

    For now as a workaround you can subscribe to the OnDataBound event of the RadScheduler and set the resources to be multi-valued in the handler:

    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <script runat="server">
            protected void RadScheduler1_DataBound(object sender, EventArgs e)
            {
                RadScheduler1.ResourceTypes.FindByName("Student").AllowMultipleValues = true;
            }
        </script>
        <telerik:RadScheduler runat="server" ID="RadScheduler1" WebServiceSettings-Path="~/Services/AppointmentService.asmx"
            WebServiceSettings-ResourcePopulationMode="ServerSide" FirstDayOfWeek="Monday"
            OnDataBound="RadScheduler1_DataBound" LastDayOfWeek="Sunday" Skin="Forest" StartInsertingInAdvancedForm="true"
            StartEditingInAdvancedForm="true" EnableDescriptionField="true" MultiDayView-UserSelectable="true"
            ShowResourceHeaders="true" EnableAdvancedForm="true">
        </telerik:RadScheduler>
    </asp:Content>

    I am sending you the edited project back.

    Hope this helps.

    Regards,
    Veronica Milcheva
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top