Set Target Folder When AsyncUpload is in grid

2 posts, 0 answers
  1. Bryan Hughes
    Bryan Hughes avatar
    130 posts
    Member since:
    Oct 2005

    Posted 18 Jan 2013 Link to this post

    How can I set target folder for AsyncUpload when it is in a GridTeplateColumn in EditItemTemplate of a RadGrid?

    Thank You,
    Bryan
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Jan 2013 Link to this post

    Hi,

    One suggestion is that you can set the TargetFolder as follows.

    ASPX:
    <telerik:GridTemplateColumn>
        <EditItemTemplate>
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" TargetFolder="~/">
            </telerik:RadAsyncUpload>
        </EditItemTemplate>
    </telerik:GridTemplateColumn>

    Another suggestion is that you can set the TargetFolder in the code behind as follows.

    C#:
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item.IsInEditMode && e.Item is GridEditableItem)
        {
            GridEditableItem item = (GridEditableItem)e.Item;
            RadAsyncUpload RadAsyncUpload1 = (RadAsyncUpload)item.FindControl("RadAsyncUpload1");
            RadAsyncUpload1.TargetFolder = "~/";
        }
    }

    Hope this helps.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top