Pending Review
Last Updated: 14 Jul 2025 14:17 by Matthias
Matthias
Created on: 14 Jul 2025 14:17
Category: UI for ASP.NET AJAX
Type: Bug Report
0
HtmlChart vs. RadialGauge: Handling of subcontrols during "Render"

Hello Progress team,

we're using the HtmlChart and RadialGauge components of your Telerik for AJAX suite and are encountering some inconsistencies between the two.

To be able to use the exportable SVGs of those components server-side, we've extended your classes and added two asp:HiddenFields each, so we can post the SVG and the dimensions back to the server for further processing. (Setting the values is handled in a button OnClientClick JavaScript function, that's irrelevant to this thread.)

As of 2019, when we first introduced the respective feature in our software, the code looked like this:

  • Similar for both components
  • In both cases the additional HiddenFields get added to the Controls-List "OnInit" before the base.OnInit-event.
  • In both cases we had to override the "Render"-function to also render the HiddenField-Controls to the HTML.
public class ExportableRadHtmlChart : RadHtmlChart, INamingContainer
{
    private HiddenField _svgData = new HiddenField();
    private HiddenField _svgDimensions = new HiddenField();
    public ExportableRadHtmlChart()
    {
        _svgData.ID = "SVGData";
        _svgDimensions.ID = "SVGDimensions";
    }

    protected override void OnInit(EventArgs e)
    {
        Controls.Add(_svgData);
        Controls.Add(_svgDimensions);
        
        base.OnInit(e);
    }
    
    protected override void Render(HtmlTextWriter writer)
    {
        writer.RenderBeginTag(HtmlTextWriterTag.Div);

        base.Render(writer);

        _svgData.RenderControl(writer);
        _svgDimensions.RenderControl(writer);

        writer.RenderEndTag();
    }
}

and

public class ExportableRadRadialGauge : RadRadialGauge, INamingContainer
{
    private HiddenField _svgData = new HiddenField();
    private HiddenField _svgDimensions = new HiddenField();
    public ExportableRadRadialGauge()
    {
        _svgData.ID = "SVGData";
        _svgDimensions.ID = "SVGDimensions";
    }

    protected override void OnInit(EventArgs e)
    {
        Controls.Add(_svgData);
        Controls.Add(_svgDimensions);
        
        base.OnInit(e);
    }

    protected override void Render(HtmlTextWriter writer)
    {
        writer.RenderBeginTag(HtmlTextWriterTag.Div);

        base.Render(writer);

        _svgData.RenderControl(writer);
        _svgDimensions.RenderControl(writer);

        writer.RenderEndTag();
    }
}

With this code, we've been running the Telerik product version 2023.1.323.45.

 

Now, we've updated to Telerik product version 2025.1.416.462 and are experiencing the following inconsistencies:

  1. Using the same code as before, the HiddenFields of class "ExportableRadHtmlChart" render twice:


    Whereas previously, they've only rendered once:

    Removing the custom "Render"-function of the class "ExportableRadHtmlChart" resolves this issue. (Having duplicates of those HiddenFields actually causes issues on repeated PostBacks, as two HiddenFields at a time have the same ClientID and thus their values get packed as a comma separated list before transmission to the server, which in turn yields issues when parsing the SVG, which in reality are multiple comma separated SVGs.

    The SVG values are truncated in this view, but the dimensions paint a pretty clear picture, as to what's happening here after 4 PostBacks.) Despite requiring to make this adjustment to our software, we're glad, we can discard that custom "Render"-function.
  2. The "ExportableRadRadialGauge", on the other hand, still only renders the HiddenFields with the custom "Render"-function included. Can we expect a similar fix to the RadialGauge, s.t. we don't require to render the HiddenFields ourselves?

As I'm unsure of the "Theme name", I've put "ControlDefault". But I don't think that should matter too much. If it does, I'll try to find the correct value.

Kind regards,
Matthias

 


    0 comments