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.

Value cannot be null error

Thread ID:

Created:

Updated:

Platform:

Replies:

82687 Jun 18,2009 06:34 PM Jun 20,2009 07:22 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 18, 2009 06:34 PM

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.\r\nParameter 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#

Administrator [Syncfusion]
Replied On June 19, 2009 12:24 PM

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.

Lingaraj S [Syncfusion]
Replied On June 20, 2009 07:22 AM

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.

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.

;