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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cell changed event

Thread ID:

Created:

Updated:

Platform:

Replies:

28718 May 9,2005 02:05 PM UTC May 16,2005 04:43 PM UTC Windows Forms 5
loading
Tags: GridControl
Majesh Peedikakandy
Asked On May 9, 2005 02:05 PM UTC

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 ??

Administrator [Syncfusion]
Replied On May 9, 2005 03:27 PM UTC

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.

Adam Russell
Replied On May 16, 2005 03:46 AM UTC

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

Administrator [Syncfusion]
Replied On May 16, 2005 03:43 PM UTC

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

Adam Russell
Replied On May 16, 2005 04:34 PM UTC

Great ... any ETA? Thanks

Administrator [Syncfusion]
Replied On May 16, 2005 04:43 PM UTC

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.

CONFIRMATION

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.

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

;