After upgrading 6.4.0.15, ''Object referrence not set to an instance of an object'' message is raising.

Hi,

After upgraded latest Syncfusion 6.4.0.15 version, this problem has raised.

I have one DataBoundGrid inherited from Syncfusion.Windows.Forms.Grid.GridDataBoundGrid, in that grid if I change data in a cell and press tab then it is throwing 'Object referrence not set to an instance of an object' exception at EndEdit method.

The code I have written is there is like:

private void dataBoundGrid_CurrentCellAcceptedChanges(object sender,
CancelEventArgs e)
{
if (dataBoundGrid.CurrentCell.IsEditing)
{
dataBoundGrid.CurrentCell.ConfirmChanges();
}

if (dataBoundGrid.Binder.IsEditing)
{
dataBoundGrid.Binder.EndEdit(); //Here I am getting 'Object reference not set an instance' exception.
}
}

Please let me know why EndEdit() is throwing this exception and the way to avoid it?


5 Replies

NR Nirmal Raja Syncfusion Team November 24, 2008 09:32 PM UTC

Hi Kishan,

Thank you for your interest in Syncfusion control.

The Binder has to be wrapped into the BeginEdit and EndEdit ofth current cell

Please refer the code below:

this.gridDataBoundGrid1.BeginUpdate();
if (gridDataBoundGrid1.CurrentCell.IsEditing) {
gridDataBoundGrid1.CurrentCell.EndEdit();
}
if (gridDataBoundGrid1.Binder.IsEditing) {
gridDataBoundGrid1.Binder.EndEdit();
}
this.gridDataBoundGrid1.EndUpdate();


Let me know if you have any queries.

Regards,
Nirmal



AD Administrator Syncfusion Team November 25, 2008 10:50 AM UTC

Hi,

Thanks for reply.

Already we have above code in my application.
Problem still exist.

These problems were raised after upgraded 6.4.0.15 version.
1) If I click shift+tab at first row first column then this exception raised.

2) If I click tab after entering any of the cell value then this exception raised.

Please suggest me, why EndEdit() method is raising this exception and what way to avoid it?

Thanks
Kishan



RC Rajadurai C Syncfusion Team December 4, 2008 04:02 PM UTC

Hi Kishan,

I was unable to reproduce this behavior in my side. However, i think the following forum thread will give you an idea on preventing this exception being raised.

Please refer this.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=99

Regards,
Rajadurai



AD Administrator Syncfusion Team December 10, 2008 07:36 AM UTC

Hi,

Atlast I found my problem, but it's not my problem.
In new version 6.4.0.15, cellvalues are not accepting null values. So that, Object reference not set an instance exception is raising.

How to avoid this exception, without changing existing null values in new version of syncufusion?

Thanks
-Kishan



RC Rajadurai C Syncfusion Team December 12, 2008 12:42 PM UTC

Hi Kishan,

Sorry for the delayed response.

Please provide us a sample in which the exception has been thrown. So that, we can fix the issue and provide you a solution.

Regards,
Rajadurai


Loader.
Up arrow icon