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

An exception in Custom cell renderer.

Hello, I have made a custom cell renderer which displays a GridControl inside a GridControl. I noticed this exception when an entry was invisible (in the child gridcontrol) when it was highlighted. Please reply in this regard. (Syncfusion version: 1.6.0.8) --------------------- System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.GridModelFloatingCells.CanFloatCell (GridCellModelBase cellModel, Int32 rowIndex, Int32 colIndex, GridStyleInfo style, GridQueryFloatCell query) at Syncfusion.Windows.Forms.Grid.GridModelFloatingCells.FloatCell(Int32 rowIndex, Int32 colIndex, GridRangeInfo& boundsInfo) at Syncfusion.Windows.Forms.Grid.GridModelFloatingCells.EvalDelayedFloatCells (GridRangeInfo range, GridRangeInfo& boundsInfo) at Syncfusion.Windows.Forms.Grid.GridModelFloatingCells.EvaluateFloatingCells (GridRangeInfo range, GridRangeInfo& boundsInfo) at Syncfusion.Windows.Forms.Grid.GridModelFloatingCells.EvaluateFloatingCells (GridRangeInfo range) at Syncfusion.Windows.Forms.Grid.GridControlBase.set_GridBounds(Rectangle value) at Syncfusion.Windows.Forms.Grid.GridControlBase.DrawGrid(Graphics g, Rectangle bounds, Boolean drawCurrentCell) at XTreme.BO.GUI.GridInCellRenderer.OnDraw(Graphics g, Rectangle clientRectangle, Int32 rowIndex, Int32 colIndex, GridStyleInfo style) ---------------------------- Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net

4 Replies

AD Administrator Syncfusion Team May 23, 2005 08:39 AM UTC

What do you mean by "when an entry was invisible "? Do you mean you have a hidden row / column in your cell renderer grid? If so, how are you hiding it? There are a couple of ways to hide a column/row. You can set its rowheight or columnwidth to be zero, or you can set grid.Cols.Hidden[index] = true. You might swicth teh way you are hiding things to see if that will avoid this problem? Can you reproduce this problem in any of the sample that we ship? If so, we can try to debug it here.


MA Maqsood Ahmed May 23, 2005 08:55 AM UTC

Hello, By invisible I meant that the row was visible with the data but as soon as I clicked the row, its data became invisible (painting issue may be). The row was not invisible using any other techniques you have mentioned. I think my query is a bit clear now. TIA. Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net


AD Administrator Syncfusion Team May 23, 2005 09:50 AM UTC

The exception is probably causing the row to go away when you click it. Can you see this exception in the sample we ship? If it is that grid.FloatingCells object that is null, you can try calling grid.Initialize() on your embedded grid after you create it to see if that will handle this problem. Or, you could try instanciating the object yourself using grid.FloatingCells = new GridModelFloatingCells(gridControl1.Model); Or, if you do not need floating cells, you could set: grid.FloatCellsMode = GridFloatCellsMode.None;


MA Maqsood Ahmed May 23, 2005 10:12 AM UTC

Hello, This problem does not reproduce often. It was the first time I had seen this exception in logs. grid.FloatingCells is a readonly (get) property... although I have applied grid.Initailize() solution. Lets hope it''ll work. Thanks Maqsood Ahmed Kolachi Advanced Technologies http://www.kolachi.net

Loader.
Live Chat Icon For mobile
Up arrow icon