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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error in RowHeader Cells - help debugging

Thread ID:





63780 Jul 10,2007 12:00 AM UTC Jul 17,2007 09:52 PM UTC WinForms 7
Tags: GridControl
Julie Levy
Asked On July 10, 2007 12:00 AM UTC

Hi -
We are sporadically getting an error in the rowheader column in the GridControl (using See the attached screenshot. The column is red with, i think, the word Exception in it.
It's hard to reproduce, only happening on some machines and i prevent the user from resizing the row header column. I haven't been able to reproduce it on my machine and make the rowheaders resizeable.

Any help with what can cause this? Where to add more error handling (events)?

I don't really do much with this column... just turn on the rowheader property and set the image.



haneefm [Syncfusion]
Replied On July 10, 2007 10:55 PM UTC

Hi Julie,

I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in browser sample with Essentail studio V.4.x/5.x. But i was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the browser sample to reproduce the issue here? This will help us to analyse the issue further.

Best regards,

Julie Levy
Replied On July 11, 2007 06:16 PM UTC

Hi Haneef -
It's happening in a stand alone Windows EXE, not a winform embedded in the browser when data is loaded into the grid - not based on any user interaction. It's really hard to reproduce - i've never actually seen it on my machine and our QA only sees it every once in a while.

What causes the grid to paint red like this? Is it a problem with the rowheader column or is it just being used to display some other error?

Is there any event you can recommend i try to catch an error? I've already got a try-catch in the following events:

Like i said, it's the rowheader column which i don't do much with other than set/unset the image and cancel dragging and resizing.

Any debugging advice you can offer would be great.


haneefm [Syncfusion]
Replied On July 11, 2007 11:10 PM UTC

Hi Julie,

Normally this issue happens in the following reasons:

1) Recursive calls of the QueryCellInfo Event Handler
2) Are you using multiple threads? If so accessing the grid on a different thread might cause this
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

Here is a sample that causing this issue (Recursive call of the Query cellinfo).

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.

Please let me know if this helps.

Best regards,

Julie Levy
Replied On July 12, 2007 04:40 PM UTC

Hi Haneef -
thanks for your response.
1. I don't actually handle QueryCellInfo - it's not a virtual grid.
2. We are not multi-threading.
4. It's not a databound grid.

3. We do, however, update the datasource of combobox cells. Is there a way to de-activate cells in a column? What's the safest way to update the datasource of combobox cell? We do this alot.


Julie Levy
Replied On July 12, 2007 04:46 PM UTC

Info on how i update the datasource -
I rebuild/reset the GridStyleInfo for the cell using the following code (note that MxrDataSet is just our derived DataSet object).

private void AddDropDownCell( int rowIndex, int colIndex, GridLookup lookup, string lookupFilter, object cellValue)
GridStyleInfo style = new GridStyleInfo();
MxrDataSet dsList = null;
DataTable dtSource = null;

if (lookup != null)
dsList = lookup.GetFilteredListData( lookupFilter );
if (dsList != null)
dtSource = dsList.WorkingTable;

style.ReadOnly = false;
style.Enabled = true;
style.BackColor = Color.White;
style.DropDownStyle = GridDropDownStyle.AutoComplete;
style.DataSource = dtSource;
style.DisplayMember = lookup.DisplayFieldTag;
style.ValueMember = lookup.ValueFieldTag;
style.CellValue = cellValue;
style.VerticalAlignment = GridVerticalAlignment.Middle;

this.Data[rowIndex, colIndex] = style.Store;

haneefm [Syncfusion]
Replied On July 12, 2007 11:19 PM UTC

Hi Julie,

You can try setting the Style.Enabled property to false in a QueryCellInfo to disable the Combobox cell.

Best regards,

Julie Levy
Replied On July 17, 2007 09:52 PM UTC

Hi Haneef -
i'm not sure i understand. Are you saying i should disable the combobox cell before I set the datasource and then re-enable it?

I don't handle QueryCellInfo, i build each cell using a style object like in my code above during a load event called by the host of my control.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon