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

Grid problem with v.

Hi, since we are using Syncfusion v. including the patch 2.1.15 the following code doesn''t work anymore: // first increase the rowcount (grid now hast 2 rows) gridControlFundAttributes.RowCount++; // indexToStart is 2 gridControlFundAttributes.Rows.Hidden[indexToStart] = true; gridControlFundAttributes[indexToStart, 1].HorizontalAlignment = GridHorizontalAlignment.Left; gridControlFundAttributes[indexToStart, 1].BackColor = FISConstants.GridDataColor; gridControlFundAttributes[indexToStart, 1].Font.Bold = true; gridControlFundAttributes[indexToStart, 1].Text = allGroupData.Name; // this statement produces the following error: // allGroupData is a business object gridControlFundAttributes[indexToStart, 0].Tag = allGroupData; the stack trace produces the following error: Caught an exception: >>> >>> Object reference not set to an instance of an object. >>> >>> at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) >>> at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType) >>> at Syncfusion.Windows.Forms.Grid.GridModel.ChangeCells(GridRangeInfo range, GridStyleInfo[] cellsInfo, StyleModifyType modifyType) >>> at Syncfusion.Windows.Forms.Grid.GridModel.Syncfusion.Windows.Forms.Grid.IGridVolatileDataContainer.ChangeCell(Int32 rowIndex, Int32 colIndex, GridStyleInfo style) >>> at Syncfusion.Windows.Forms.Grid.GridVolatileData.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfo value) >>> at Syncfusion.Windows.Forms.Grid.GridStyleInfoIdentity.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_Tag(Object value) Any hints, tips, fixes I would appreciate - because it definitely worked before v. Thanks in advance Michael Mann

4 Replies

MM Michael Mann September 28, 2004 08:24 AM UTC

One additional note: ColCount is set to 3

AD Administrator Syncfusion Team September 28, 2004 09:22 AM UTC

Exactly what version was the code working for ( or something else?)? I tried to see the problem in this little sample using a non-virtual GridControl, and it seems to be working as expected? I assume your grid is a GridControl? Are you using it in a virtual manner? ForumTag_4991.zip

MM Michael Mann September 30, 2004 10:13 AM UTC

The version it was running before was v. Yes, I am using a gridControl in a derived way. It''s used quite often, but in two of x cases it doesn''t work. And only in that case the whole app crashes. The derived control overrides just a few OnXXXXXX methods, nothing special. Do you have a guess? I''m trying to construct a sample app to provide some source Michael Mann

AD Administrator Syncfusion Team October 5, 2004 07:37 AM UTC

Now I got the problem. The application failed when an object was set as the tag object in the grid. Recent changes to that object in the Clone implementation caused the failure. That means when the object''s Clone() method has been invoked, the application failed. So, this issue can be closed. Thanks for the help Michael

Live Chat Icon For mobile
Up arrow icon