Is there a way to show RadProgressArea as popup mode?

2 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 12 Aug 2012 Link to this post

    Is there  a way to show RadProgressArea as popup mode?
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Aug 2012 Link to this post

    Hi Jin,

    Based on this Code Library you can show RadProgress Area in modal popup as follows.

    ASPX:
    <telerik:RadProgressManager ID="RadProgressManager1"
          runat="server"
          OnClientProgressStarted="OnClientProgressStartedHandler" />
    <asp:Panel ID="panel1" runat="server">
    <telerik:RadProgressArea ID="RadProgressArea1"
          runat="server"
          Skin="Vista">
    </telerik:RadProgressArea>
    </asp:Panel><%--TargetFolder="~/uploads" --%>
    <telerik:RadUpload ID="RadUpload1"
          runat="server"
          Skin="Vista">
    </telerik:RadUpload>
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> <br />
    <br />
    <ajaxToolKit:ModalPopupExtender ID="ModalPopupExtender1"
          TargetControlID="hiddenTargetControlForModalPopup"
          BackgroundCssClass="myClass"
          PopupControlID="panel1"
          runat="server">
    </ajaxToolKit:ModalPopupExtender>
    <asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />

    Javascript:
    <script type="text/javascript">
    function OnClientProgressStartedHandler(sender, e)
    {
       var modalPopupBehavior = $find('ModalPopupExtender1');
       modalPopupBehavior.show();
     }
    </script>

    C#:
    protected void Button1_Click(object sender, EventArgs e)
        {
            RadProgressContext context = RadProgressContext.Current;
            context.SecondaryTotal = "100";
            for (int i = 1; i < 100; i++)
            {
                context.SecondaryValue = i.ToString();
                context.SecondaryPercent = i.ToString();
                context.CurrentOperationText = "Doing step " + i.ToString();
                if (!Response.IsClientConnected)
                {
                    //Cancel button was clicked or the browser was closed, so stop processing
                    break;
                }
                // simulate a long time performing the current step
                System.Threading.Thread.Sleep(100);
            }    
        }

    Thanks,
    Princy.
Back to Top