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

Advanced Form Resource Combobox selected value is always null

1 Answer 79 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 13 Dec 2012, 08:31 AM
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;
    }
}

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 18 Dec 2012, 09:08 AM
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.
Tags
Scheduler
Asked by
Kevin
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or