The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, How do I format the contents of a cell containing double values if the double value is NaN? I want to display "" rather than "NaN" in this case. Is there an event I can intercept for this?
AJAjish Syncfusion Team August 28, 2007 10:22 PM UTC
Hi Paul,
If you want to display the formatted text in a cell then subscribe the QueryCellFormattedText event and set the e.Text to your new formatted value and then set e.Handled to TRUE to cancel default format. Here is a code snippet to show this,
if (e.Style.CellValue != null) { double d; double.TryParse(e.Style.CellValue.ToString(), out d);
if (double.Equals(d,double.NaN ) ) { e.Text = "Haha!!!" + d; e.Handled = true; } } } Kindly try the above and let me know if this helps in resolving this issue.