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.
Unfortunately, activation email could not send to your email. Please try again.

CellButtonClick consuming my exceptions?

Thread ID:

Created:

Updated:

Platform:

Replies:

30046 Jun 9,2005 12:07 PM Jun 9,2005 01:35 PM Windows Forms 1
loading
Tags: GridControl
John Passarelli
Asked On June 9, 2005 12:07 PM

In the CellButtonClicked event, if I throw an exception it does not bubble up, but rather the grid code consumes it (but does write it out to the debugger output). Is this by design? I am using version 3.0.1 of the GridDataBoundGrid.

Administrator [Syncfusion]
Replied On June 9, 2005 01:35 PM

This is by design. Here the code.
public bool RaiseCellButtonClicked(int rowIndex, int colIndex, int index, GridCellButton button)
{
	TraceUtil.TraceCurrentMethodInfoIf(Switches.CurrentCell.TraceVerbose, PaneDesc, rowIndex, colIndex, index, button);
	GridCellButtonClickedEventArgs e = new GridCellButtonClickedEventArgs(rowIndex, colIndex, index, button);
	try
	{
		OnCellButtonClicked(e);
	}
	catch (Exception ex)
	{
		TraceUtil.TraceExceptionCatched(ex);
		if (!ExceptionManager.RaiseExceptionCatched(this, ex))
			throw ex;
		e.Cancel = true;
	}
	return !e.Cancel;
}
This code also shows how you can make the grid rethrow the exception. It uses the ExceptionManager class in Shared. Syncfusion.Windows.Forms.ExceptionManager that has static members that you can use to control how the grid handles exceptions. For example, to suspend the grid''''s error handling, try Syncfusion.Windows.Forms.ExceptionManager.SuspendCatchExceptions = true; You can also hook an event (Syncfusion.Windows.Forms.ExceptionManager.ExceptionCatched) to get any exception thrown, and handle them yourself.

CONFIRMATION

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.

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.

;