Remove the Uploaded files from Asyn Upload FileList

2 posts, 0 answers
  1. Himagiri
    Himagiri avatar
    8 posts
    Member since:
    Oct 2012

    Posted 21 Jan 2014 Link to this post

    Hi,
    I have a telerik multi tab control. In the first tab, I have a Rad Grid which displays list . On click of each row second tab displays details. Second tab contains Rad Async Upload control.If files are uploaded for a particular Item and after save if another row is clicked previous uploaded files are retained. I want to remove the files uploaded for previous row.Please advise.

    Thanks,
    Himagiri
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jan 2014 Link to this post

    Hi Himagiri,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">
        <Tabs>
            <telerik:RadTab Text="Grid" PageViewID="RadPageView1">
            </telerik:RadTab>
            <telerik:RadTab Text="Details" PageViewID="RadPageView2">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
        <telerik:RadPageView ID="RadPageView1" runat="server">
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
                <ClientSettings EnablePostBackOnRowClick="true" Selecting-AllowRowSelect="true">
                </ClientSettings>
            </telerik:RadGrid>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                SelectCommand="SELECT top 10 [OrderID], [CustomerID], [ShipAddress],[OrderDate] FROM [Orders]">
            </asp:SqlDataSource>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server">
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" TargetFolder="Uploads">
            </telerik:RadAsyncUpload>
            <telerik:RadButton ID="RadButton1" runat="server" Text="Save" OnClick="RadButton1_Click">
            </telerik:RadButton>
        </telerik:RadPageView>
    </telerik:RadMultiPage>

    C#:
    protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
    {
        RadTab tab = (RadTab)RadTabStrip1.FindTabByText("Details");
        tab.Selected = true;
        RadPageView page = (RadPageView)tab.PageView;
        page.Selected = true;
    }
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        RadTab tab = (RadTab)RadTabStrip1.FindTabByText("Grid");
        tab.Selected = true;
        RadPageView page = (RadPageView)tab.PageView;
        page.Selected = true;
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top