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

Cell referenced in formula

Thread ID:

Created:

Updated:

Platform:

Replies:

82402 Jun 11,2009 06:00 PM UTC Jun 20,2009 06:10 AM UTC WinForms 3
loading
Tags: GridControl
Melinda Peirce
Asked On June 11, 2009 06:00 PM UTC

Is there a way to find the cell or range that is referenced in a formula?

for instance, if my formula is '=Display!B17', I would like to be able to 'go to' or perform some change on the cell that is referenced in the formula, Grid display, cell B17.

I have looked through some of the methods in the formula engine, but I am not seeing anything that looks like the functionality I am looking for.

I can probably write a routine to parse it out, but I thought I would check to see if anyone has done it, or if the control itself has a way.

thanks,
M

Jisha Joy [Syncfusion]
Replied On June 12, 2009 11:33 AM UTC

Hi Melinda,

You can use the following code to achieve the desired behavior.

GridRangeInfo range = GridRangeInfo.Parse("B17");
int col = range.Top;

Please let me know if this helps.

Regards,
Jisha

Melinda Peirce
Replied On June 12, 2009 01:40 PM UTC

Tried this, I get an "Invalid Range" exception on the GridRangeInfo.Parse("B12")

I guess i am wondering if there are methods in the formula engine that can get information about the cell(s) being referenced.. are they public or can they be made public? And, do any retrieve any information besides the value?

What I am trying to do is this: I am building a large workbook in a tab/grid. I am reading the data out of an existing excel workbook. Most of the workbook pages need to be read only and disabled. I have another page in the excel workbook that lists all of the cells that should be marked as enabled. I would like to list them in a format similar to the formula =Certification!B12:F12 (without the '=') Then, as I read through the list be able to set the style on each cell or range.

So, I need to be able to first find the correct sheet/grid, then change the appropriate cells on that grid.

Thoughts on a simple way to do this?
thanks,

Rajadurai C [Syncfusion]
Replied On June 20, 2009 06:10 AM UTC

Hi Melinda,

Thanks for your interest in Syncfusion Products.

In GridFormulaEngine, there are two properties available through which we can retrieve formula dependencies for a cell.
1) GridFormulaEngine.DependentCells - Gets a mapping between a cell and a list of formula cells that depend on it.
2) GridFormulaEngine.DependentFormulaCells - Gets a mapping between a formula cell and a list of cells upon which it depends.

These properties maintain a collection of its own regarding cell dependencies.

Please refer to the following minimal sample in which the dependent cells of a cell can be retrieved and displayed on listbox placed in form while clicking on the formula cell.
http://files.syncfusion.com/support/samples/Grid.Windows/7.2.0.20/F82402.zip

Regards,
Rajadurai

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.

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

;