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

Get bad index when NamedRange has been removed

Thread ID:





33108 Aug 12,2005 03:22 PM UTC Jun 21,2007 06:32 AM UTC WinForms 2
Tags: GridControl
Najmeh Joze-khajavi
Asked On August 12, 2005 03:22 PM UTC

In sample code "$\Program Files\Syncfusion\Essential Suite\\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

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

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));

Replied On June 21, 2007 06:32 AM UTC

hai ,

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


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