Reputation: 6070
What I am trying to do is to concatenate or merge two columns in single column in kendo Grid.
I tried to do it but no success so far also searched for it but still not getting how to do it??
I want to concatenate two or three columns in single e-g
First Name
Middle Name
Last Name
All should be shown in single
Full Name
Here is some of my kendogrid code.
$("#EmployeeGrid").kendoGrid({
dataSource:{
transport: {
read: "<?php echo base_url() ?>index.php/hr_management/manage_hr/list_view"
},
schema:{
data: "data"
}
},
columns: [
{
field: "EmployeeID",
hidden:true
},
{
field:"LastName"
},
{ field: "LastName"+"FirstName",
title:"Full Name"
},
{
field:"City",
title:"City"
},
{
field:"AddressLine1",
title:"Address 1"
},
{
field:"WorkPhone",
title:"WorkPhone"
},
{
field:"MobileNo",
title:"Mobile No"
},
{command: { text: "View", click: showDetails }, title: " ", width: "140px"},
{command: { text: "Edit", click: EditUserDetails }, title: " ", width: "140px"}
]
});
});
Upvotes: 2
Views: 5158
Reputation: 210
Another example that worked in Angular 8:
<kendo-grid-column field="LastName" title="Last, First">
<ng-template kendoGridCellTemplate let-dataItem>
{{ dataItem.LastName}}, {{ dataItem.FirstName }}
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="MiddleName" title="Middle"></kendo-grid-column>
Upvotes: 0
Reputation: 20203
The answer is to use template column:
template:"#= FirstName # #= MidName # #= LastName #"
Upvotes: 5