Example usage of TelerikLinearGauge used within a TelerikGrid GridColumn

0 Answers 92 Views
Grid LinearGauge
Jerdobi
Top achievements
Rank 1
Iron
Iron
Jerdobi asked on 19 Nov 2022, 10:42 PM | edited on 22 Nov 2022, 07:09 AM

Scenario:

Put a visual Linear Gauge into a GridColumn so to show a visual perspective of a count instead of a number.

Issue:

On first page render the Grid to the page, the TelerikLinearGauge shows.   If I exit to another page and then come back to the page, the TelerikLinearGauge will not render, and the column is now blank.  

How to Refresh:

There must be some trick to having the image of the gauge re-render on subsequent refreshes of the page.  I hate guessing and think this is a typical scenario that should be documented on your site.  Right?

Preferred Approach:

The Linear Gauge will render and refresh just like all the other columns without custom workarounds and/or techniques.

 

Telerik.Blazor.Components.TelerikLinearGauge LinearGaugeRef { get; set; }

Code:

 <GridColumn Field="@nameof(PackageRequest.ViewCount)" Title="Views" Width="40px" Visible="false">
            <Template>
                @{
                    var item = context as PackageRequest;
                    @if (item.ViewCount > 0)
                    {
                        <TelerikLinearGauge>
                            <LinearGaugeScales>
                                <LinearGaugeScale Min="0" Max="@TotalViewCount" Vertical="false">
                                    <LinearGaugeScaleMinorTicks Visible="false"></LinearGaugeScaleMinorTicks>
                                </LinearGaugeScale>
                            </LinearGaugeScales>
                            <LinearGaugePointers>
                                <LinearGaugePointer Value="@item.ViewCount" />
                            </LinearGaugePointers>
                        </TelerikLinearGauge>
                    }
                }
            </Template>
        </GridColumn>

No answers yet. Maybe you can help?

Tags
Grid LinearGauge
Asked by
Jerdobi
Top achievements
Rank 1
Iron
Iron
Share this question
or