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

DropDownList in InlineInsertTemplate

1 Answer 57 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 14 Nov 2013, 08:37 PM
Im confused as how this should work. I've setup a schedule and now want to add a dropdownlist to both the advanceinsert and inlineinsert. Everything works fine in the advanced form but I cant get the inilneform to work. Not sure how to get it going. I've looked at every demo as well as every forum post and cant seem to figure it out.

Any help would be great.

<InlineInsertTemplate>
    <div>
        <asp:DropDownList ID="ddlOrganizations" runat="server" Width="238px"></asp:DropDownList>
        <br />
        <telerik:RadTextBox ID="rtbSubject" runat="server" TextMode="MultiLine" Columns="35" EmptyMessage="Title" Text='<%# Bind("Subject") %>'></telerik:RadTextBox>
        <br />
        <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">
            Submit
        </asp:LinkButton>
        <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More">
            Advanced
        </asp:LinkButton>
          
        <asp:LinkButton ID="CancelButton" runat="server" CommandName="Cancel">
            Cancel
        </asp:LinkButton>
    </div>
</InlineInsertTemplate>
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        SetupResources();
    }
}
 
 
private void SetupResources()
{
    ResourceType resType = new ResourceType();
    resType.ForeignKeyField = "OrganizationID";
    resType.DataSource = Organizations.OrganizationList(false);
    resType.KeyField = "OrganizationID";
    resType.Name = "Organization";
    resType.TextField = "OrganizationName";
    rsProjectSchedule.ResourceTypes.Add(resType);
}

protected void rsProjectSchedule_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
{
    if (e.Container.Mode == SchedulerFormMode.Insert)
    {
        DropDownList ddl = (DropDownList)e.Container.FindControl("ddlOrganizations");
        ddl.DataSource = Organizations.OrganizationList(false);
        ddl.DataTextField = "OrganizationName";
        ddl.DataValueField = "OrganizationID";
        ddl.DataBind();
    }
}


1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 19 Nov 2013, 03:42 PM
Hello,

I would suggest reviewing our demo that shows how you can set the appointment type (the appointment type is actually a resource) from the inline insert or edit form.


Regards,
Boyan Dimitrov
Telerik
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 the blog feed now.
Tags
Scheduler
Asked by
Curt
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or