Columns Recompute
Let's review the columns collection and it's role in the Recompute
- Columns that are not added to the column collection will not participate in the recompute
BindValue will only recompute based on columns that were added before it in the Columns Collection
- Add a local column EndOfMonth
public class DemoColumnsCollection : UIControllerBase
{
public readonly Models.Orders Orders = new Models.Orders();
public readonly DateColumn EndOfMonth = new DateColumn("EndOfMonth");
public DemoColumnsCollection()
{
From = Orders;
Columns.Add(Orders.OrderID);
Columns.Add(Orders.CustomerID);
Columns.Add(Orders.OrderDate);
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.DemoColumnsCollectionView(this);
}
}
- Add a BindValue for the
EndOfMonthcolumn
public class DemoColumnsCollection : UIControllerBase
{
public readonly Models.Orders Orders = new Models.Orders();
public readonly DateColumn EndOfMonth = new DateColumn("EndOfMonth");
public DemoColumnsCollection()
{
From = Orders;
Columns.Add(Orders.OrderID);
Columns.Add(Orders.CustomerID);
Columns.Add(Orders.OrderDate);
Columns.Add(EndOfMonth).BindValue(() => Orders.OrderDate.EndOfMonth);
}
public void Run()
{
Execute();
}
protected override void OnLoad()
{
View = () => new Views.DemoColumnsCollectionView(this);
}
}
- Note that in the migrated code, the call to
BindValuewill be attached to theColumns.Addcall for that column - Note that if the
Columns.Addof theEndOfMonthcolumn is after the call toColumns.Addof theOrders.OrderDatecolumn, the value ofEndOfMonthwill automatically change whenever the value ofOrders.OrderDatechanges - Note that if the
Columns.Addof theEndOfMonthcolumn is Before the call toColumns.Addof theOrders.OrderDatecolumn, the value ofEndOfMonthwill NOT automatically change whenever the value ofOrders.OrderDatechanges, it'll only evaluate once when you enter the row. - We can use Alt + up arrow to move a line of code up, or Alt + down arrow to move a line of code down
Debugging
- Break into the code using the Shift + F12
- In the "Watch" window, use the
__RecomputePathproperty of any column, to see the columns that when changed, will cause this column to recompute

- You can also use the 'Make Object ID' right click option, to highlight columns (or any object) in the watch window and the columns collection, using the
{$1}symbol.


Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com