named cell

i thought the namedrangesforformulas sample would show me this .. but no i basically want to call a cell fred and then in another cell enter =fred+10% or =SHEET2!fred+10% i can see how i get fred into the engine but how do i associate fred with a cell ? also if i do formaulacellselection can i make it enter fred rather than a3 thanks

3 Replies

AD Administrator Syncfusion Team September 17, 2005 08:16 AM UTC

Hi Kevin, You can name a cell and a range in GridFormulaEngine using the AddNamedRange Function. GridFormulaEngine engine; engine = ((GridFormulaCellModel)gridControl1.Model.CellModels["FormulaCell"]).Engine; engine.AddNamedRange("fred","A1"); engine.AddNamedRange("Arow","A1:A10"); Best regards, Stanley


KV Kevin Vickers September 19, 2005 08:54 AM UTC

can i have the same name registered for multiple sheets so Sheet1!fred Sheet2!fred


AD Administrator Syncfusion Team September 19, 2005 10:13 AM UTC

Hi Kevin, Sure, you can give a try and the code for registering multiple grids as sheets to have cross sheet reference is below. int sheetfamilyID = GridFormulaEngine.CreateSheetFamilyID(); GridFormulaEngine.RegisterGridAsSheet("sheet1", this.gridControl1.Model, sheetfamilyID); GridFormulaEngine.RegisterGridAsSheet("sheet2", this.gridControl2.Model, sheetfamilyID); GridFormulaEngine.RegisterGridAsSheet("sheet3", this.gridControl3.Model, sheetfamilyID); Best regards, Stanley

Loader.
Up arrow icon