I want to display a grid where it shows invitee information and – and that’s the tricky part – columns indicating which mails they have received.
For instance, a grid like this:
Firstname | Lastname | ReceivedMail1 | ReceivedMail2
If a third mail is created in the application, I the grid needs to add a column like this:
Firstname | Lastname | ReceivedMail1 | ReceivedMail2 | ReceivedMail3
My database is relational, so there’s someting like person.receivedEmails with a collection of e-mails.
I’m looking for a best practice to go about this. I’m working in C# in a WinForms app, but I need this for my webapp too. I am considering a dynamic object (although I’m not sure how good that works with the grid), or maybe a database view. Any suggestions?
OK, this is how I’m going to do it.
Thanks to Adding-properties-To-ExpandoObjects and Binding-ExpandoObjects-ToDatagrid
Here’s a prototype:
using that method from the 2nd link:
Result is EXACTLY like I wanted. 🙂