We would like to illustrate how to enable an animated loading indicator for long-running operations in Syncfusion’s GridGroupingControl for Windows Forms. We do this by using a helper that asynchronously uses the .NET framework API ImageAnimator.
The helper, being written in a generic manner, can bind the animated loading indicator to any user interface control of the Control type.
Member Type | Name | Description |
Static Method | Wire | Wires the control with the loading indicator and starts the animation. |
Static Method | UnWire | Unwires the control from the loading indicator and stops the animation. |
Static Property | Image | Gets or sets the animated image with multiple frames. |
Table1: LoadingAnimator – Properties and Methods
To wire the loading animator with the control before starting the long-running operation, the following code has to be handled in the respective event.
Using the following code in the respective event, the loading animator can be unwired once the long-running process is complete.
The default, animated image can be replaced with another image through the static Image property.
The following screenshots show the loading animator’s behavior for handling operations like loading, sorting, grouping, and filtering with a large set of records.
;
After Loading Data
While Sorting by a Column
After Sorting by a Column
While Grouping by a Column
After Grouping by a Column
While Filtering
After Filtering
The link below takes you to a sample that illustrates these operations both programmatically (through menu items at the top) and at the UI level (through user interaction).