Customize WPF databinding: How to add custom logic?
Posted
by Ashwani Mehlem
on Stack Overflow
See other posts from Stack Overflow
or by Ashwani Mehlem
Published on 2010-04-29T09:13:37Z
Indexed on
2010/04/29
9:17 UTC
Read the original article
Hit count: 401
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.
© Stack Overflow or respective owner