# Integration with Expression Editor

Learn how TreeView supports integration with the Expression Editor control.

## Content



TreeView supports integration with the Expression Editor control. When integrated with Expression Editor, expressions can be used to perform operations such as column calculation over the data in TreeView. These expressions can be used on all the node levels available in the TreeView control.

To integrate Expression Editor with the TreeView, you need to use [ExpressionInfo](/componentone/docs/win/online-treeview/) property of <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-treeview/\u0022\u003e.NET\u003c/a\u003e assemblies." data-popup-title="C1TreeColumn" data-popup-theme="ui-tooltip-green qtip-green">C1TreeColumn</span> class, which contains information about expressions. These expressions can be set for columns using [Expressions](/componentone/docs/win/online-treeview/) property of **ExpressionInfo** class.

The following image shows the TreeView control integrated with Expression Editor.

![TreeView with ExpressionEditor](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/integrationwithexpressioneditor.png)

The ExpressionInfo class provides various other properties listed below that can be used to manipulate expressions in TreeView control. These properties can be used to add, edit, or delete expressions on any of the node levels available in TreeView.

| **Property** | **Description** |
| --- | --- |
| AllowAddNew | Indicates the ability to add node level expression |
| AllowDelete | Indicates the ability to remove node level expression |
| AllowEdit | Indicates whether the expressions of this column can be edited by clicking the Expression Editor icon in the column header |
| ExpandLastExpression | Indicates whether the last expression expand to all subsequent levels of the TreeView even if the expression is not defined for them |

The following code demonstrates integration of TreeView with Expression Editor. In this code, expression is used on the fifth column of the TreeView control which contains two levels. Here, we have added an expression for the second level only.For this, we set our expression to the second item of the Expressions array, and set the first item as empty.

```csharp
private void Form1_Load(object sender, EventArgs e)
{            
     this.categoriesTableAdapter.Fill(this.c1NWindDataSet.Categories);
     this.productsTableAdapter.Fill(this.c1NWindDataSet.Products);
     c1TreeView1.BindingInfo.DataSource = c1NWindDataSetBindingSource;
     c1TreeView1.Columns[4].ExpressionInfo.Expressions = new
                string[] { "", "[UnitPrice]*([UnitsInStock]+[UnitsOnOrder])" };
     c1TreeView1.Columns[4].ExpressionInfo.AllowEdit = new bool[] { true, true };
     c1TreeView1.Columns[4].ExpressionInfo.AllowAddNew = true;
     c1TreeView1.Columns[4].ExpressionInfo.AllowDelete = true;
 }
```