开发者

How to create a custom field when using WCF RIA?

开发者 https://www.devze.com 2022-12-14 08:11 出处:网络
I have a table with \"first name\" and \"last name\". When binding to a datagrid I need to have a column named \"name\", which is \"first name\" + SPACE + \"last name\".

I have a table with "first name" and "last name". When binding to a datagrid I need to have a column named "name", which is "first name" + SPACE + "last name".

I am using a DomainDataSource tag in XAML, is there any method to bind a column "first name" + SPACE + "last name"?

Is there any method like defin开发者_开发百科ing a class to have for the table in EDMX?

Public string fullname { get { return firstName+"_"+lastName; } }

Thanks.


I'm not 100% certain I understand the problem, but a couple solutions come to mind:

  1. Your query against the database can return a virtual column or
  2. You can add a view to the db with the name column created out of the first and last or
  3. You can give your business object a name property that would be set from the first and last and would get the full name

-jesse


Finally, I added a xxxxx.shared.cs to added a column to return to client side.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号