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

Query Cell Info events and recursive calls

Hi,
I'm trying to trigger an event from a checkbox and display the 'check'. I used your query cell info example but no matter what I do I get this recursive call error:

System.InvalidOperationException: Recursive call detected. When accessing grid cell objects from a QueryCellInfo event handler make sure you do not recursively access the same cell.

Even if I just hover over the grid, I get this issue. Is there a more straightforward way to just check the cell GDBG[row, col].checked = true? I've been trying to unravel this for days with no luck.

3 Replies

AD Administrator Syncfusion Team December 8, 2006 09:46 AM UTC

I am sorry, but it is not clear to me what you are trying to do.

In general, you cannot use code like grid[row,col] in QueryCellInfo because just indexing the grid triggers calls to QueryCellInfo.

Here is a little sample the displays the value of a CheckBox column in a Label on the Form anytime QueryCellInfo is requesting a cell in that column. You get the value from the e.Style that is passed in through the event args (and not from indexing the grid).

http://www.syncfusion.com/Support/user/uploads/GDBG_CheckBox_6a3cbc32.zip

If this is not enough information to allow you to do what you want, if you can explain further what you are trying to do, or if you can upload a sample and explain what is not working in your sample, maybe we can suggest something else.


AD Administrator Syncfusion Team December 8, 2006 09:57 AM UTC

Hi ,
You can use the CheckBoxClick event to catch the action of checking/unchecking a checkbox.

private void gridDataBoundGrid1_CheckBoxClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
Console.WriteLine(this.gridDataBoundGrid1[cc.RowIndex, cc.ColIndex].Text);
Console.WriteLine("gridDataBoundGrid1_CheckBoxClick");
}

Here is a small sample:
GDBG_CheckBox.zip
Best Regards,
Jeba.


AD Administrator Syncfusion Team December 8, 2006 02:45 PM UTC

Thank you Jeba and Clay - With your help, I found the problem.

Loader.
Live Chat Icon For mobile
Up arrow icon