We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SaveCellFormattedText event fired twice?

Thread ID:





20084 Oct 8,2004 05:07 PM UTC Oct 8,2004 09:06 PM UTC WinForms 2
Tags: GridControl
Sassan Danesh
Asked On October 8, 2004 05:07 PM UTC

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; }

Administrator [Syncfusion]
Replied On 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.

Administrator [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon