Declined
Last Updated: 24 Jul 2025 06:48 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

 


    5 comments
    Matthias
    Posted on: 24 Jul 2025 06:48
    Thanks so much for taking a second look at it and keeping us in the loop.
    ADMIN
    Rumen
    Posted on: 23 Jul 2025 12:23

    Hi Matthias,

    Thank you for the clarification.

    You are absolutely right - these changes to the RadHtmlChart rendering were introduced to ensure that Telerik-internal elements like the ClientState HiddenField are consistently rendered, even when controls are added dynamically to the Controls collection. This change had the side effect of also rendering any user-added controls, such as your custom HiddenFields, without needing to override Render.

    We appreciate you pointing out the inconsistency with the Radial Gauge. As of the current version, RadRadialGauge does not yet include the same rendering adjustment, which is why overriding the Render method is still necessary in your case.

    We have logged this internally for review and potential unification of behavior between these components. In the meantime, continuing to override Render for Radial Gauge is the correct workaround.

    Thank you again for your thorough explanation and for highlighting this edge case. If there is any update on the Radial Gauge side, we will be sure to share it. 

      Regards,
      Rumen
      Progress Telerik

      Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
      Matthias
      Posted on: 16 Jul 2025 15:38
      And sorry for the bold text; I don't know, what happened there...
      Matthias
      Posted on: 16 Jul 2025 15:37

      Hello Attila,

      actually, I'm not, in any, way suggesting, that you should revert the changes made to HtmlChart. I've only included that part to illustrate the changes made by you to HtmlChart. (Prior to which, it wouldn't render the controls added to the htmlChart.Controls collection by itself.) I'm assuming, you've made this change, because you've added a HiddelField "ClientState" to HtmlChart yourselves and now require to render this one anyways.

      If anything, I was expecting you to apply the same changes to the RadialGauge control, such that RadialGauge's "Render"-method by default renders the additional Controls added to radialGauge.Controls collection; which is basically, what happens for the HtmlChart now by default.

      Kind regards,
      Matthias

      ADMIN
      Attila Antal
      Posted on: 16 Jul 2025 14:47

      Hello Matthias,

      Thank you for bringing this to our attention.

      We understand that you've built a custom implementation by extending our component, and that it had worked well in the past. We also recognize how frustrating it can be when something that previously functioned stops working after an upgrade.

      After reviewing the situation, we’ve confirmed that the issue is specific to the customized version. Our component behaves as expected in its standard, unmodified form. As such, and in line with our support policy, we’re unable to provide assistance for issues arising from custom implementations.

      That said, if your current workaround continues to meet your needs, we fully support you in using it. We appreciate your efforts in adapting our product to your use case and hope it continues to serve you well.

      Please don’t hesitate to reach out if you encounter any issues with the standard functionality—we’re here to help.

      Regards,
      Attila Antal
      Progress Telerik

      Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources