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

Cell changed event

i have a combobox in a grid and i am handling the CurrentCellChanged event.But every time i change the comobox item , this event is called twice instead of once.What could be the problem ??

5 Replies

AD Administrator Syncfusion Team May 9, 2005 10:27 AM

Some things to check. Check if you are somehow subscribing to the event twice. For example, if you are using VB, do you have both a AddHandler statement subscribing to the event as well as a Handles clause on the event handler? Are you explicitly calling grid.CurrentCell.COnfirmChanges somewhere (or EndEdit or some other call that might force the cell to save teh change earlier than it might do so normally). Try adding the event handler to this sample and see if it only gets hit once there. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\CellTypes\ComboboxCells If you can upload a sample showing the problem, maybe we can spot it here.


AR Adam Russell May 15, 2005 10:46 PM

I''m observing similar behavior--it looks like CellsChanged is being fired twice. I believe this is occurring because of the following series of calls in CellModelBase.ApplyFormattedText: ... style.CellValue = < some value > style.ResetError(); ... Both ultimately generate OnCellsChanged calls. I believe this behavior is relatively new. Clay, is this correct? Is there a workaround/resolution? Some bugs / performance issues have crept into our apps because of this ... Thanks


AD Administrator Syncfusion Team May 16, 2005 10:43 AM

This is a bug. We have corrected it in our source here, and it should be in the next point release. Here is the modified method. public virtual bool ApplyText(GridStyleInfo style, string text) { GridCellTextEventArgs ea = new GridCellTextEventArgs(text, style, null, -1); Grid.RaiseSaveCellText(ea); if (!ea.Handled) { CultureInfo ci = CultureInfo.CurrentCulture; NumberFormatInfo nfi = ci != null ? ci.NumberFormat : null; try { style.BeginUpdate(); style.CellValue = GridCellValueConvert.Parse(text, style.CellValueType, nfi, ""); style.ResetError(); } catch (Exception ex) { style.Error = ex.Message; if (style.StrictValueType) throw; else if (ex is FormatException || ex.InnerException is FormatException) { style.CellValue = text; // Possibly could also change CellValueType here based on input string. // e.Style.CellValueType = typeof(string); } else throw; } finally { style.EndUpdate(); } } return true; }


AR Adam Russell May 16, 2005 11:34 AM

Great ... any ETA? Thanks


AD Administrator Syncfusion Team May 16, 2005 11:43 AM

The next scheduled point release is the end of this month. I do not know if this goal will be made or not. If you would like a private build (of dll''s only) with this fix, you can submit a direct track requesting one.

Loader.
Live Chat Icon For mobile
Up arrow icon