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.

Get bad index when NamedRange has been removed

Thread ID:

Created:

Updated:

Platform:

Replies:

33108 Aug 12,2005 11:22 AM Jun 21,2007 02:32 AM Windows Forms 2
loading
Tags: GridControl
Najmeh Joze-khajavi
Asked On August 12, 2005 11:22 AM

In sample code "$\Program Files\Syncfusion\Essential Suite\3.0.1.6\Windows\Grid.Windows\Samples\Quick Start\NamedRangesForFormula", by right click and "Edit Inputs" I added Medical key and value 200. Then I used it in Cashflow sheet "=Medical". It came nicely as 200. Now, I want to remove Medical from NamedRange. Again I am using context menu and "Edit Inputs". I got bad index in cell. It is obvious that Medical is in use and I shouldn''t be able to remove it. Is there any event that I can catch this? The worse case is if I used "=Medical + 2" and then I remove Medical I got unhandled exception in SyncfusionGrid.Windows.dll for invalid char in front of +. Basically I want to do error checking and avoid improper deleting. I am using Syncfusion 3.0.1.6.

Administrator [Syncfusion]
Replied On August 12, 2005 01:00 PM

I do not have a good suggestion for handling this problem. Our Calculate library actually has a property that tells the engine to rethrow parsing error so you can catch them if you want. But I am not sure even whether adding that property to the GridFormulaEngine would allow you to catch this particular error or not. We will have to research this to see what might be possible. You can actually catch this behavior in SaveCellInfo if you want. The idea is that anytime a formulacell is saved whith an error, you catch it. Here is a snippet that worked for me in that sample you mentioned. Due to the errors being raised, this event is actually hit more than once, so you may have ot add code to make sure you only do something one time.
private bool CheckIfError(string s)
{
	foreach(string s1 in this.engine.FormulaErrorStrings)
	{
		if(s1 == s)
			return true;
	}
	return false;
}
private void gridCashFlow_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
	if(e.Style.CellType == "FormulaCell" 
		&& e.Style.Text.Length > 1
		&& e.Style.Text[0] == ''=''
		&& CheckIfError(e.Style.FormattedText))
	{
		MessageBox.Show(string.Format("error {0},{1}  {2}", e.RowIndex, e.ColIndex, e.Style.FormattedText));
	}
}

mayilsamy
Replied On June 21, 2007 02:32 AM

hai ,

how to increase the height and width in Syncfusion grid tell the syntax.

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.

;