Skip to content

SyncfusionExamples/how-to-use-custom-control-with-calcengine-

Repository files navigation

How to use custom control with calcengine

This example demonstrates how to use the custom control with CalcEngine

You can use any of Tools to in our CalcEngine. But it should be derived from ICalcData.

this.grid.ItemsSource = dt.DefaultView; 
engine = new CalcEngine(this.grid); 
 
public class CustomGrid : DataGrid,ICalcData 
{ 
    public CustomGrid() 
    { } 
 
    public event ValueChangedEventHandler ValueChanged; 
 
    public object GetValueRowCol(int row, int col) 
    { 
        if (row < 0 || col < 0) 
            return "Invalid cell"; 
        string s = (this.Items[row-1] as DataRowView).Row.ItemArray[col-1].ToString(); 
        return s; 
    } 
 
    public void SetValueRowCol(object value, int row, int col) 
    { 
        //To set the value to specific cell.    
    } 
 
    public void WireParentObject() 
    { 
         //To trigger any of event for parent. This method is called when calcEngine assigned the parent object as CustomDataGrid. 
    } 
}

About

This example demonstrates how to use the custom control with CalcEngine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages