How to render the ASP.NET Core Progressbar inside grid control?
Description
This article shows how to render the ASP.NET Core Progress bar inside grid control.
Solution
A Progress bar is a graphical or visual representation of the progress of a task or process. It can be rendered using the ASP.NET Core Progressbar control. The progress bar features can be explored from the progress bar examples.
You can render the progress bar control inside the grid by using the template property in the Column of the grid. In the template property, you can set the id of the element where the progress bar is displayed. You can set the progress bar values in the grid component by using the created event. This event is triggered after the grid is rendered, allowing you to manipulate the progress bar values as needed.
Code Snippet
The following code helps to render the progress bar inside the grid.
<div id="progressbar" class="row">
<div class="cols-sample-area">
<script type="text/x-template" id="columnTemplate1">
<div id="prgbar${BarID}" />
</script>
<div id="grid">
<ejs-grid id="grid" created="loadComplete">
<e-grid-columns>
<e-grid-column field="BarID" headerText="ID"></e-grid-column>
<e-grid-column headerText="ProgressBar" template="#columnTemplate1" textAlign="@Syncfusion.EJ2.Grids.TextAlign.Center"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
</div>
</div>
<script>
function loadComplete(args) {
setTimeout(function () {
for (var i = 1; i < 4; i++) {
var linear = new ej.progressbar.ProgressBar({
id: ''+i,
type: 'Linear',
width: '95%',
height: '60',
value: 50,
progressColor: "green",
trackThickness: 15,
progressThickness: 15,
animation: {
enable: true,
duration: 2000,
delay: 0,
},
});
linear.appendTo('#prgbar' + i);
}
}, 1000)
}
</script>
The following image illustrates the output of the above code
Conclusion
I hope you enjoyed learning how to render the ASP.NET Core Progressbar inside grid control.
You can refer to our ASP.NET Core Progressbar feature tour page to learn about its other features and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET Core Progressbar example to understand how to create and visualize data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comment section below. You can also contact us through our support forums, support portal, or feedback portal. We are always happy to assist you!