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.
I have implemented handlers for QueryCellFormattedText and SaveCellFormattedText in order to allow percentage field handling (where user types ''5'' and this is treates as 5%).
However, I notice that my handler receives two SaveCellFormattedText events for every cell change. Is this normal? My implementation of the handler is:
String userValue = null;
if(evt.Text[evt.Text.Length-1] == ''%'')
{
userValue = evt.Text.Substring(0, evt.Text.Length - 1);
evt.Handled = true;
}
else
{
userValue = evt.Text;
}
double d;
if (double.TryParse(userValue, System.Globalization.NumberStyles.Any, null, out d))
{
userValue = "" + (d / 100d);
evt.Handled = true;
}
if (evt.Handled)
{
evt.Style.Text = userValue;
}
ADAdministrator Syncfusion Team October 8, 2004 08:58 PM UTC
I see SaveCellFormattedText being raised twice as well. The first time happens as the grid tries to validate the cell contents. The second time occurs later jast as the grid is trying to save the value to the grid.
I am not sure whether this is by design or not. I will have to forward it to Stefan to see if this is what he had in mind.
ADAdministrator Syncfusion Team October 8, 2004 09:06 PM UTC
This is by design. The cell renderer class internally calls style.FormattedText = ControlText to determine the underlying cell value for the display text. This happens before the CurrentCellValidate event is raised and ensures the ControlValue for the renderer is up to date.
Stefan