This is a migrated thread and some comments may be shown as answers.

How to add a linear gauge/ progress bar in an kendo mvc grid column

9 Answers 1154 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Leya
Top achievements
Rank 1
Leya asked on 12 Feb 2015, 12:03 PM
Hi,

Can anyone help me with this:

How to add a linear gauge/ progress bar in an kendo mvc grid column

I couldn't find any sample for it

9 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 12 Feb 2015, 02:01 PM

Hello Leya,

In order to add a Kendo UI widget in a column, you could add a template with the markup required for the widget and then use the dataBound event of the Grid to initialize it. Here is a small example, that demonstrates the approach. It is basically the same in the MVC Grid.

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Minh
Top achievements
Rank 1
answered on 25 Sep 2015, 01:37 PM

Hi Dimiter,

Can you provide a small example using the MVC Grid?

Thanks

0
Dimiter Madjarov
Telerik team
answered on 25 Sep 2015, 04:03 PM

Hello Minh,

You should add the div elements via client template (assuming Ajax binding is used)

columns.Bound(p => p.Freight).ClientTemplate("<div class='progress'></div>");
attach a handler to the dataBound event of the Grid
.Events(e => e.DataBound("dataBound"))
and then initialize the widgets in the dataBound handler
function dataBound() {
    var grid = this;
 
    grid.tbody.find("tr[role='row']").each(function () {
        var model = grid.dataItem(this);
 
        $(this).find(".progress").kendoProgressBar({
            value: model.Freight
        });
    });
}

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Mosh
Top achievements
Rank 1
answered on 15 Aug 2016, 08:54 AM

im looking to get this to work with editable gird 

maybe through the template

0
Dimiter Madjarov
Telerik team
answered on 16 Aug 2016, 07:43 AM

Hello Mosh,

There should not be any differences in the approach, when applying it to editable Grid. Let us know if we could provide assistance regarding it.

Regards,
Dimiter Madjarov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Sven
Top achievements
Rank 1
answered on 26 Feb 2017, 11:34 AM

Hello Dimiter,

would this also work for several progressbars in several columns? I would like to show printer ink levels, so I need four different progress bars in each row (CMYK). Your solution works only for one progress bar, right?

Thanks!
Sven

0
Dimiter Madjarov
Telerik team
answered on 28 Feb 2017, 05:06 PM

Hello Sven,

The approach could work for ProgressBars in several columns. You could for example set different CSS classes to them in order to differentiate them.
E.g.

columns.Bound(p => p.Freight).ClientTemplate("<div class='progress'></div>");
columns.Bound(p => p.Freight2).ClientTemplate("<div class='progress2'></div>");

and then use this CSS class in the dataBound event handler to find them.
E.g.
function dataBound() {
    var grid = this;
  
    grid.tbody.find("tr[role='row']").each(function () {
        var model = grid.dataItem(this);
  
        $(this).find(".progress").kendoProgressBar({
            value: model.Freight
        });
 
        $(this).find(".progress2").kendoProgressBar({
            value: model.Freight2
        });
    });
}

I hope this information helps.

Regards,
Dimiter Madjarov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Saravana
Top achievements
Rank 1
commented on 05 Jul 2022, 03:20 PM | edited

I am trying to add a linear gauge to a kendo grid using this approach. I am using ASP.NET Core + Javascript. My kendo grid has 1 linear gauge column. It takes around 200 to 250 ms to create linear gauge for a single row. I was able to bring this time down to 150 to 200 ms range by setting transitions option to false. Is there anything else that I can do to further bring down the loading time of the grid?

It takes about 5 minutes to load 2000 rows in a kendo grid with a linear gauge column. Without the linear gauge column, it takes about 30 seconds. 

I would really appreciate any tips on how I can further improve the performance of the grid with a linear gauge column?
0
Sven
Top achievements
Rank 1
answered on 02 Mar 2017, 06:35 PM

Hello Dimiter,

thanks, this works great.

Can you please give me a hint how to style these progress bars inside the grid? I am new to ASP.Net and not sure what the best practice would be like. I would like to limit the width of the progress bars as well as their height, and I would like to color them according to printer ink (cyan, magenta and yellow).

Thanks in advance,

Sven

0
Stefan
Telerik team
answered on 06 Mar 2017, 02:25 PM
Hello Sven,

I can suggest checking the demo for the custom labels in the ProgressBar:

http://demos.telerik.com/aspnet-mvc/progressbar/customlabel

As a best practice, we recommend the approaches shown on our demo page, how-to examples and the widgets API and this is applicable for all of the widgets:

http://demos.telerik.com/aspnet-mvc/

http://docs.telerik.com/aspnet-mvc/helpers/progressbar/how-to/use-with-grid-for-crud-operations

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Leya
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Minh
Top achievements
Rank 1
Mosh
Top achievements
Rank 1
Sven
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or