Oskar Zetterberg
Sep 6, 2011
  4260
(0 votes)

Small bug in XFormStatisticsControl

Had a problem where the statistics control didn’t render properly when using StatisticsType N (number). After a bit of digging with reflector it all came down to the priavte method GenerateOutputForNumbers and adding the cssstyle attribute to the panel. The calculated number of em is of type float and when that type is converted to string and the value is decimal it will be rendering a “,” when it should render a “.” as css ain´t to keen on commas.

I had to build my own control inheriting from the original one with this small change to that private method:

panel.Attributes.CssStyle.Add(HtmlTextWriterStyle.Width, num2.ToString().Replace(",", ".") + "em"); instead of panel.Attributes.CssStyle.Add(HtmlTextWriterStyle.Width, num2 + "em");

Sep 06, 2011

Comments

Please login to comment.
Latest blogs
Optimizely CMS 13 and the Alloy demo site

The Alloy demo site now runs on Optimizely CMS 13. Here’s a quick guide to getting it up and running locally.

Tomas Hensrud Gulla | Apr 10, 2026 |

A day in the life of an Optimizely OMVP: Getting Up to Speed with Optimizely CMS 13 — A Free Learning Path

If you're working with Optimizely and haven't started exploring CMS 13 yet, now's the time. I've put together a dedicated CMS 13 course within the...

Graham Carr | Apr 10, 2026

A day in the life of an Optimizely OMVP: Optimizely CMS 13 Is Here: The Features, The Add-Ons, and What's Coming Next

CMS 13 went GA on 31st March 2026, and after months of previews, webinars, and internal engineering sessions, it's finally real. I've been deep in...

Graham Carr | Apr 10, 2026

How to get the Page Tree back in Optimizely CMS

Lost the page tree in Optimizely CMS? Here's why it happens and the non-obvious fix to get it back.

Henning Sjørbotten | Apr 10, 2026 |