Customize DataColumn.Expression handling in C #

I would like to change the behavior DataColumn.Expressionso that when writing:

DataColumn.Expression = "MyMethod(Price)"

It will call MyMethod, pass the value from the Price column into it and display the estimated value.

How can i do this?

+3
source share
2 answers

Impossible. The expression parser behind the Expression property is simple and does not expand. Making arbitrary function calls is not one of its capabilities. There are several ways around this, especially those that do not require an expensive search for reflection. For example, consider the DataTable.RowChanged event.

+4
source

- , . . , [Price] . , , . .

, , , .

+1

Source: https://habr.com/ru/post/1722446/


All Articles