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.

GGC: Exception thrown after editting a cell

Thread ID:

Created:

Updated:

Platform:

Replies:

37156 Nov 16,2005 12:17 PM Nov 17,2005 04:57 AM Windows Forms 3
loading
Tags: GridControl
Roberto Obispo
Asked On November 16, 2005 12:17 PM

Hi, I''m having a problem with a Grouping Grid Control. I have one of these grids with a dataset as data source. One of the columns contanis decimal numbers, with the format "0.00". The grid also has a summary row for that column, with the same format. The exception comes when I edit a cell on that column. The program performs some operations on the columnchanged event of the datatable, which add and remove some rows. All that operations are performed successfully, and then it''s when the exception is thrown. This is the text of the exception: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.Grouping.GridRecord.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.EndUpdate() 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 I have another grid, almost with the same data, in other part of the program. It does the same operations when editting a cell on the same column, and it doesn''t throw any exception. Any clue of what may be happening here? Thanks a lot in advance! Roberto Obispo

Administrator [Syncfusion]
Replied On November 16, 2005 03:29 PM

Try handling the SourceListListChanged event and tell the grid not reset the currentrecord when the datasource is changed from outside the grid to see if this has any effect on this problem.
private void gridGroupingControl1_SourceListListChanged(object sender, TableListChangedEventArgs e)
{
	e.ShouldResetCurrentRecord = false;
}

Roberto Obispo
Replied On November 17, 2005 02:45 AM

Hi, Clay. It has no effect... I''ve also tried removing any format/style on the column, but keeps showing the same error. The dataset has no errors after the operations triggered by the edition. Any other suggestions? Thanks a lot Roberto

Administrator [Syncfusion]
Replied On November 17, 2005 04:57 AM

Are there multiple threads involved? If so, whenever you are interacting with the grid in some manner, are you doing a grid.InvokeRequired check to make sure you are on the thread that created the grid? If not, you can get null references and other miscellaneous errors like this. Another thing to try. Since you are dynamically adjusting the rows in your datasource inside a column changed event, the grid may be in teh middle of handling the initiating change, and removing/inserting rows at this point may be causing the problem (though the event suggested above tries to avoid these situations but just in case...). Something to try is to not directly do the work of inserting / removing the data inside your ColsChanged event handler. Instead, raise a timer event to postpone this work slightly so the ColsChnaged event can return and let the grid complete its work. Then in the timer Tick event, do the work of removing/adding the rows. (This is just something to try to ID the problem.) If you own the source code for our libraries, you can build a debug version and be able to drill down into the exception to see exactly what the null value is, and that may point to some way to avoid this. If you can upload a sample project showing this issue, we can try debugging it here.

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.

;