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

Error in RowHeader Cells - help debugging

Hi -
We are sporadically getting an error in the rowheader column in the GridControl (using 4.4.0.51). 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.

Thanks,
Julie

RowHeader_Error.zip

7 Replies

HA haneefm Syncfusion Team 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,
Haneef


JL Julie Levy 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:
QueryAllowDragColumnHeader
PrepareViewStyleInfo
SelectionChanging
ResizingColumns

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.

Thanks,
Julie


HA haneefm Syncfusion Team 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).
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.
RedXExceptionSample.zip

Please let me know if this helps.

Best regards,
Haneef


JL Julie Levy 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.

Thanks,
Julie


JL Julie Levy 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.CellType = CELLTYPE_COMBOBOX;
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;
}


HA haneefm Syncfusion Team 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,
Haneef


JL Julie Levy 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.
Thanks,
Julie

Loader.
Live Chat Icon For mobile
Up arrow icon