c# - 我怎样才能使 Telerik 进度条工作?

标签 c# asp.net telerik

我的项目中有一个 Telerik 进度条:

<telerik:RadProgressManager ID="RadProgressManager" Runat="server" />
<telerik:RadProgressArea ID="RadProgressArea" Runat="server"></telerik:RadProgressArea>   
<asp:button id="Button1" runat="server" text="Submit" />

点击按钮我尝试运行这个方法:

private void MethodWhichUpdatesTheProgressContext(UploadedFile file, int countFile)
{
     const int total = 100;
     RadProgressContext ProgressContex = RadProgressContext.Current;
     ProgressContex.SecondaryTotal = "100";

     for (int i = 0; i < total; i++)
     {
         ProgressContex.CurrentOperationText = "Uploading zip file percentage " + i.ToString();                

         if (!Response.IsClientConnected)
         {                    
             break;
         }

         System.Threading.Thread.Sleep(100);
     }
}

项目构建没有任何错误,但进度没有改变。 如何正确触发进度条动画? 如果我把这个进度条放在控件上,它会影响这个吗?

最佳答案

增加循环内的 ProgressContex.SecondaryValueProgressContex.SecondaryPercent:

    for (int i = 0; i < 100; i++)
    {
        ProgressContex.CurrentOperationText = "Uploading zip file percentage " + i.ToString();
        ProgressContex.SecondaryValue = i.ToString();
        ProgressContex.SecondaryPercent = i.ToString();
    }

另请参阅:

RadProgressArea Custom Progress

关于c# - 我怎样才能使 Telerik 进度条工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6251957/

相关文章:

c# - C# 中用于窗口创建/最大化/最小化等的全局钩子(Hook)

asp.net - 我是否真的无法在商业应用程序中使用 Codeplex 的 Telerik Asp.NET MVC 控件?

jquery - AngularJS 中的 Kendo UI 颜色选择器无法设置宽度

javascript - 捕获jqGrid中下拉菜单的更改/点击事件

c# - 将复杂类型的字典绑定(bind)到 RadioButtonList

asp.net - 插入查询语法问题

c# - 使用 telerik 在 radForm 中更改标题栏文本颜色

c# - 如何使用 ClosedXML 从 excel 文件中读取单元格值

c# - 为什么在 ZedGraph 中 Y 轴很小?

c# - 如何只更新已更改的字段?