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.

GridGroupingControl & TableControlCurrentCellValidated

Thread ID:

Created:

Updated:

Platform:

Replies:

31577 Jul 11,2005 04:54 AM Jul 11,2005 06:23 AM Windows Forms 3
loading
Tags: GridControl
Mikaël Morvan
Asked On July 11, 2005 04:54 AM

Hi, I want to save the current record when i move to another cell (not only when i move to another row). To do this, i use the TableControlCurrentCellValidated event and EndEdit function : private void Grid_TableControlCurrentCellValidated(object sender, GridTableControlEventArgs e) { if (this.ggc_grid.Table.CurrentRecord != null) this.ggc_grid.Table.CurrentRecord.EndEdit(); } When i try it an exception occurs : System.InvalidOperationException: AddNew not called at Syncfusion.Grouping.AddNewRecord.SetValue(FieldDescriptor fieldDescriptor, Object value) at Syncfusion.Windows.Forms.Grid.Grouping.GridAddNewRecord.Syncfusion.Windows.Forms.Grid.Grouping.IGridTableCellStyleChanged.RaiseTableCellStyleChanged(GridTableCellStyleInfoEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoIdentity.OnStyleChanged(StyleInfoBase style, StyleInfoProperty sip) at Syncfusion.Styles.StyleInfoBase.OnStyleChanged(StyleInfoProperty sip) at Syncfusion.Windows.Forms.Grid.GridStyleInfo.OnStyleChanged(StyleInfoProperty sip) at Syncfusion.Styles.StyleInfoBase.SetValue(StyleInfoProperty sip, Object value) at Syncfusion.Windows.Forms.Grid.GridStyleInfo.set_CellValue(Object value) at SageCoala.Cool.Compta.JournalForm.Grid_SaveCellFormattedText(Object sender, GridCellTextEventArgs e) in c:\my projects 2\sagecoala.cool\dllcool\compta\journalform.cs:line 527 at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.OnSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.RaiseSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridEngine.OnSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridEngine.RaiseSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.Grouping.GridTableModel.OnSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.GridModel.RaiseSaveCellFormattedText(GridCellTextEventArgs e) at Syncfusion.Windows.Forms.Grid.GridCellModelBase.ApplyFormattedText(GridStyleInfo style, String text, Int32 textInfo) at Syncfusion.Windows.Forms.Grid.GridStyleInfo.ApplyFormattedText(String text) at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.OnSaveChanges() at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.RaiseSaveChanges() at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown) catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown) in :line 0 What is the problem, and how can i fix it ? Is there another solution to have this behavior ? Regards, Mikaël

Administrator [Syncfusion]
Replied On July 11, 2005 05:14 AM

Try using the RecordValueChanged event, calling e.Record.EndEdit() in your handler, to see if that will avoid this problem.

Mikaël Morvan
Replied On July 11, 2005 06:03 AM

Ok, it avoid the problem. Now when i use the append row and i validate a cell, the row was save and a new append row appears, and the current cell move to the new append row. How can i prevent the current cell move to the new append row ?

Administrator [Syncfusion]
Replied On July 11, 2005 06:23 AM

If you end the edit early on the addnew row, there is no way to avoid the grid putting the newly added row in its proper position. You cannot avoid doing this if you call record.EndEdit to save the changes wherever you leave a cell. If you do not want this to happen, you would have to avoid calling EndEdit for the AddNew row. if(!(e.Record is GridAddNewRecord)) e.Record.EndEdit();

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.

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.

;