DropDownList in InlineInsertTemplate

2 posts, 0 answers
  1. Curt
    Curt avatar
    82 posts
    Member since:
    Sep 2012

    Posted 14 Nov 2013 Link to this post

    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();
        }
    }


  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 19 Nov 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top