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
close icon

Value cannot be null error

I'm getting an error message box popup when I tab out or click out of a grid cell. The error message is: "Value cannot be null. Paremeter name: key".
The stack trace is below and is a little different depending on whether I tab out or click out, but still ends up with the popup message box.

Don't know if this is useful information but the grid cell uses a derived GridDropDownGridListControlCellModel. My derived version'd renderer sets this:
ListControlPart.Grid.VScrollPixel = false;
...in the constructor but that's about it.

Any ideas?

System.Windows.Forms.dll!System.Windows.Forms.MessageBox.ShowCore(System.Windows.Forms.IWin32Window owner = {CityView.AppUIWinForm.BinderPanel}, string text, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, System.Windows.Forms.MessageBoxOptions options, bool showHelp) + 0x220 bytes
System.Windows.Forms.dll!System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window owner, string text) + 0x29 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.DisplayWarningText(string message = "Value cannot be null.\rParameter name: key") + 0x11a bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.RaiseValidateFailed(int colIndex = 2) + 0x124 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnCurrentCellMoveFailed(Syncfusion.Windows.Forms.Grid.GridCurrentCellMoveFailedEventArgs e = {Syncfusion.Windows.Forms.Grid.GridCurrentCellMoveFailedEventArgs}) + 0xa8 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellMoveFailed(int rowIndex = 4, int colIndex = 3, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions options = ScrollInView) + 0x96 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(int rowIndex = 4, int colIndex = 3, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions options = ScrollInView, bool discardChanges = false) + 0x677 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveTo(int rowIndex = 4, int colIndex = 3, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions options = ScrollInView) + 0x2d bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.InternalMove(Syncfusion.Windows.Forms.Grid.GridDirectionType direction = Right, int num = 0, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions options = ScrollInView) + 0x1e91 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridSelectCellsMouseController.GridCurrentCellExternalMove(Syncfusion.Windows.Forms.Grid.GridDirectionType direction = Right, int num = 1, bool extendSelection = false) + 0x322 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.Move(Syncfusion.Windows.Forms.Grid.GridDirectionType direction = Right, int num = 1, bool extendSelection = false, bool wrapCell = true) + 0xdeb bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.Move(Syncfusion.Windows.Forms.Grid.GridDirectionType direction = Right, int num = 1, bool extendSelection = false) + 0x6e bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveRight(int num = 1, bool extendSelection = false) + 0x30 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridCurrentCell.MoveRight() + 0x25 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridControlBase.OnKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData = LButton | Back}) + 0x2f6 bytes
Syncfusion.Grid.Windows.dll!Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.OnKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData = LButton | Back}) + 0x34 bytes
> CityView.AppUIWinForm.dll!CityView.AppUIWinForm.AppGrid.OnKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData = LButton | Back}) Line 3424 + 0xc bytes C#

2 Replies

AD Administrator Syncfusion Team June 19, 2009 04:24 PM UTC

I found the source of this porblem. It was an error that was happening elsewhere in my code but manifesting itself as a popup message from the grid.


LS Lingaraj S Syncfusion Team June 20, 2009 11:22 AM UTC

Hi Mark,

Thank you for your interest in Syncfusion product.

I am afraid to unable to reproduce the issue in GridDataBoundGrid. I have created the sample for custom GridListControl in GridDataBound control, Also I have attached the created sample in below link:
http://files.syncfusion.com/support/samples/Grid.Windows/Forums/GDBGGridList.zip

This sample demonstrate how to create GridListControl custom cell for Grid controls

The issue might have occurred due to the current cell EndEdit. So please try using CurrentCell.EndEdit method in CurrentCell moving event.

Refer the code below:

this.gridDataBoundGrid1.CurrentCellMoving += new GridCurrentCellMovingEventHandler(gridDataBoundGrid1_CurrentCellMoving);
void gridDataBoundGrid1_CurrentCellMoving(object sender, GridCurrentCellMovingEventArgs e)
{
if (this.gridDataBoundGrid1.CurrentCell != null)
{
this.gridDataBoundGrid1.CurrentCell.EndEdit();
}
}


Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon