Skip to content

Created based on recommendations from the How to display progress information about server-side callback processing example.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-web-forms-grid-show-operation-progress-and-cancel-operation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET Web Forms - How to show a lengthy operation's progress and allow canceling such operations

This example is created based on recommendations from the How to display progress information about server-side callback processing example.

Overview

The main idea is to divide long-time operations into different steps. Thus, if you know which step is performed, you can display the progress information:

int countOfOperations = 100;
for(int i = 0; i < countOfOperations; i++) {
    progressInPercent = Math.Round((double)i / countOfOperations * 100);
     System.Threading.Thread.Sleep(150);
    //Do some steps here
}

Or cancel the processing after finishing of one of these steps:

protected void clbCancel_Callback(object source, DevExpress.Web.CallbackEventArgs e) {
    isCancelRequired = true;
}
// ...
isCancelRequired = false;
int countOfOperations = 100;
for(int i = 0; i < countOfOperations; i++) {
    // ...
    if(isCancelRequired)
        return;
}

Files to Review

More Examples

About

Created based on recommendations from the How to display progress information about server-side callback processing example.

Topics

Resources

License

Stars

Watchers

Forks