简体   繁体   English

Kendo-Grid:一列中包含两个字段

[英]Kendo-Grid: two field in one column

I havetwo fields in my class First Name & Last Name. 我班上的名字和姓氏有两个字段。 Currently I am displaying as two column in Kendo-Grid. 目前,我在Kendo-Grid中显示为两列。 But now I want it to be display like follow: 但是现在我希望它像下面这样显示:

Name
-------------
Parker, Peter  //i.e. LastName,FirstName

I don't know how to do. 我不知道该怎么办。 Pls help. 请帮助。

(Assuming you're using asp.net MVC server-side) (假设您正在使用asp.net MVC服务器端)
Simply add a new property to your model: 只需向模型添加一个新属性:

public string CombinedNames {
    get { return Lastname + ", " + FirstName; }
}

And use that property as a column in Kendo Grid. 并将该属性用作Kendo Grid中的一列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM