I bind a GridView to a collection of objects that look like this:
public class Transaction
{
public string PersonName { get; set; }
public DateTime TransactionDate { get; set; }
public MoneyCollection TransactedMoney { get; set;}
}
MoneyCollectionjust inherits from ObservableCollection<T>and is a collection of type objects MyMoney.
In my GridView, I just want to bind a column to a method MoneyCollection ToString(). However, binding it directly to the property TransactedMoneymakes each record display the text "(Collection)", and the method is ToString()never called.
Please note that I do not want to bind to elements in MoneyCollection, I want to bind directly to the property itself and simply call ToString()on it.
I understand that it is tied to the default view for the collection. So my question is: how can I bind it to a collection so that it invokes a method on it ToString()?
This is my first WPF project, so I know it might be a bit noobish, but pointers would be very welcome.
womp source
share