Customize WPF databinding: How to add custom logic?
- by Ashwani Mehlem
Hi,
i have a question regarding some complex data-binding.
I want to be able to update a grid (which has the property
"IsItemsHost" set to true) dynamically whenever a data-binding occurs.
To be more specific, i bind the grid to some items and i want to
change the number of grid rows depending on these items,
add something like a header (one row containing some text),
and set the items' Grid.Row and Grid.Column using some custom logic.
What is the easiest way to apply such behaviour
whenever the bound data is updated?
Do i have to use a viewmodel that also contains the header data?
Thanks in advance.