vlandmist
New member
- Joined
- Mar 1, 2008
- Messages
- 3
- Programming Experience
- Beginner
Add a new calculated column in a linq datacontext datagrid ??
I start with a collection of objects that I insert in my database, and I've done that using linq and datacontext
my problem:
I want to add a column in the datagridview and I want to see the days elapsed by calculating a difference between the "StartDate" column in my database and the current date. plus I want to format it with a different color if days are > 7
but how do I add this column? I don't want to store it in the database, is redoundant and I if try to add it as a new column in the object manager .dbml I get a runtime error "Invalid column name 'ElapsedDays"... because is not databound. I can add it as Unbound column but how can I manage it?
thanks
I start with a collection of objects that I insert in my database, and I've done that using linq and datacontext
my problem:
I want to add a column in the datagridview and I want to see the days elapsed by calculating a difference between the "StartDate" column in my database and the current date. plus I want to format it with a different color if days are > 7
but how do I add this column? I don't want to store it in the database, is redoundant and I if try to add it as a new column in the object manager .dbml I get a runtime error "Invalid column name 'ElapsedDays"... because is not databound. I can add it as Unbound column but how can I manage it?
thanks