SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Bind data to additional fields Options
nsmeaton
#1 Posted : Saturday, June 27, 2009 9:44:08 PM
Rank: Newbie

Groups: Registered

Joined: 6/27/2009
Posts: 4

Hi, I need to add some databound dropdown lists as additional fields to a slickupload control.

FindControl doesn't work because the additional fields are within a template.

Has anyone done this before?

Suggestions?

Thanks.

Axosoft
#2 Posted : Monday, June 29, 2009 10:05:55 AM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Thanks for bringing this to our attention!

This isn't currently supported -- currently you'd need to render using inline statements or pull in using AJAX.

We've added databinding support to the list for the next minor version release, and should have that out in the next day or two.

Axosoft
#3 Posted : Monday, June 29, 2009 4:18:51 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

I've attached a prerelease build of v 5.2.9 with databinding support.

To do databinding for a control in the FileTemplate, handle the ItemTemplateCreated event. You can use FindControl within this event to find your control, wire up the data source, and call databind. For a FileTemplate like this:

             <FileTemplate>
                 <kw:FileListRemoveLink runat="server">[x]</kw:FileListRemoveLink>
                 <kw:FileListFileName runat="server" />
                 <kw:FileListValidationMessage runat="server" ForeColor="Red" />
                 <asp:DropDownList ID="dropDownList" runat="server" />
             </FileTemplate>

You might bind it up like this:

    protected void SlickUpload1_ItemTemplateCreated(object sender, TemplateEventArgs e)
    {
        DropDownList ddl = (DropDownList)e.Item.FindControl("dropDownList");

        ddl.DataSource = new string[] { "test", "items", "last" };

        ddl.DataBind();
    }

One caveat with this is that the template is only created once server side, and then applied for all of the files selected. If you wanted to have a different set of items for each list, you'd need to use client side databinding with AJAX.

Let me know if this works for you.

nsmeaton
#4 Posted : Monday, July 06, 2009 3:30:11 AM
Rank: Newbie

Groups: Registered

Joined: 6/27/2009
Posts: 4
I ended up redesigning my application to workaround it - but thanks for forwarding the prerelease version. Good to know that functionality is there for me if I need it.
Axosoft
#5 Posted : Saturday, July 11, 2009 2:55:42 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Attached files removed as v5.3 has been released.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.