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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

"AddNew not called" exception on Custom cell type

Thread ID:





70407 Dec 10,2007 11:54 PM UTC Dec 11,2007 09:09 PM UTC WinForms 2
Tags: GridControl
John McLean
Asked On December 10, 2007 11:54 PM UTC

Hi there

I have implemented the DateTimePickerCell Custom cell type for my GridGroupingControl (C:\Program Files\Syncfusion\Essential Studio\\Windows\Grid.Windows\Samples\2.0\CustomCellTypes\DateTimePickerCells\sample.htm). Whenever I change the value, I get the following exception:

System.InvalidOperationException was unhandled by user code
Message="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 Transpower.SAD.CommonControls.DateTimeCellRenderer.OnSaveChanges() in C:\SourceCode\MS\SAD\CommonControls\GridLogic\DatePickerCell.vb:line 78
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown)

The exception occurs in this routine:

Protected Overrides Function OnSaveChanges() As Boolean
If CurrentCell.IsModified Then
Dim style As GridStyleInfo = Grid.Model(Me.RowIndex, Me.ColIndex)
style.CellValue = Me.dateTimePicker.Value

Return True
End If
Return False
End Function

Line: style.CellValue = Me.dateTimePicker.Value

What am I missing here?

Administrator [Syncfusion]
Replied On December 11, 2007 10:30 AM UTC

In the renderer code, try changing the datePicker_ValueChange handler to

Private Sub datePicker_ValueChanged(ByVal sender As Object, ByVal e As EventArgs)
If CurrentCell.NotifyChanging() Then
CurrentCell.IsModified = True
End If
End Sub

John McLean
Replied On December 11, 2007 09:09 PM UTC

Thanks Clay


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