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
close icon

Grid Control does not paint the results

Hello,

Some times i am getting the exception shown in the screen shot. as soon as i close the screen and load the screen again it loads properly.but i am not sure why this exception happening.

i am using Essential Studio 3.3.0.0

Environment VB.NET Windows Forms(VS.NET 2003).

Please let me know the cause and the solution if any.

Thanks & Regards,
Deepak R Dubbolla



Error.zip

1 Reply

HA haneefm Syncfusion Team January 23, 2008 08:19 PM UTC

Hi Deepak,

Normally this issue happens in the following reasons.
1) Recursive calls of the QueryCellInfo Event Handler
>>>>>>>>>>>>>>>>
Here is a sample that causing this issue (Recursive call of the Query cellinfo).
GridCrasher_653.zip

Step to reproduce the issue:
1)Double click the Rating Column cells
2)Double click the Cell(0,0) that causing the issue.

In the grid control, rowindex = -1 and colindex = -1 represents the table style. So you should wrap your code in the QueryCellInfo by checking this. Or else the style properties that are provided in the QueryCellInfo will try to apply for the entire table and this might lead to recursive calls of the QueryCellInfo. I think this is the cause of the problem.


private void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
{
if(e.RowIndex > -1 && e.ColIndex > -1)
{
/// CODE
///
}
}


Here is a modified sample.
Here is a modified sample.

2) Are you using multiple threads? If so accessing the grid on a different thread might cause this
>>>>>>>>>>>>>>
Any calls into the grid must be done on the thread that creates it, and you can use grid.InvokeRequired to check for this. Please refer the KB article for more details:
Can GridControl be used in a multithreaded application

3) If you are trying to swap/change a datasource for combobox columns when there was an active cell in the column that causes this issue.
4) If you are binding to any empty table that causing this issue
5) If you have handled any of the painting events like, DrawCell, CellDrawn, DrawCellDisplayText, ..., and have some exception raised in that drawing code that causing this issue.

Also refer to this forum thread.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=33668'>http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=33668">http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=33668

Please let me know if this helps.

Best regards,
Haneef



Loader.
Live Chat Icon For mobile
Up arrow icon