Advanced Form Resource Combobox selected value is always null

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    28 posts
    Member since:
    Dec 2008

    Posted 13 Dec 2012 Link to this post

    The problem I am having is that I want to customize the insert form of a radscheduler.  I have a resource that I want to use and I have a radeditor for the description box.  The problem I am having is that I I can add the resource and the combobox populates the correct resource everything looks great but when I submit the resource value is 0 or rather the resource selectedvalue is null.  So it appears that when I click on the combobox and select an item it never changes the selected item.

    I figured out the problem.  Make sure that the ID of the resource user control in the advanced form does Not match the resourceType as this causes it to not validate the values properly.  Because the two way binding needs use the same name as the resource type.   In other words:

    (works)
    <ul class="rsResourceControls">
        <li>
            <!-- Resource controls should follow the convention Res[Resource Name] for ID -->
            <scheduler:ResourceControl runat="server" ID="ResourceTypeID" Type="ResourceType" Label="Resource type:"
                Skin='<%# Owner.Skin %>' />
        </li>
        <!-- Optionally add more ResourceControl instances here -->
    </ul>

    [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
    public object ResourceType
    {
        get
        {
            return ResourceTypeID.Value;
        }
     
        set
        {
            ResourceTypeID.Value = value;
        }
    }

    (doesn't work)
    <ul class="rsResourceControls">
        <li>
            <!-- Resource controls should follow the convention Res[Resource Name] for ID -->
            <scheduler:ResourceControl runat="server" ID="ResourceType" Type="ResourceType" Label="Resource type:"
                Skin='<%# Owner.Skin %>' />
        </li>
        <!-- Optionally add more ResourceControl instances here -->
    </ul>
    [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
    public object ResourceTypeID
    {
        get
        {
            return ResourceType.Value;
        }
      
        set
        {
            ResourceType.Value = value;
        }
    }
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2035 posts

    Posted 18 Dec 2012 Link to this post

    Hello Kevin,

    I would like to thank you for sharing that information with that community. I believe that someone will find those observations very helpful and avoid that behavior. Therefore we recommend to use the naming convention provided here to avoid the described conflict.

    Regards,
    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top