This is a migrated thread and some comments may be shown as answers.
Is there a way to show RadProgressArea as popup mode?
1 Answer 67 Views
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 12 Aug 2012, 07:36 AM
Is there  a way to show RadProgressArea as popup mode?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 13 Aug 2012, 05:39 AM
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.
Asked by
Jin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or