我需要 conccat 两列
名字 + 姓氏。
我需要创建一个列显示名称。
这是怎么做的?接收数据\网格时我不能这样做
ResultGrid = new JQGrid
{
Columns = new List<JQGridColumn>()
{
new JQGridColumn
{
DataField = "ID",
PrimaryKey = true,
Editable = false,
Visible = false,
},
new JQGridColumn
{
DataField = "FirstName",
Visible = false,
},
new JQGridColumn
{
DataField = "LastName",
Visible = false,
},
new JQGridColumn
{
DataField = "EmployeeDisplay",
Editable = false,
Searchable = true,
DataType = typeof(Int32),
SearchToolBarOperation = SearchOperation.IsEqualTo,
SearchType = SearchType.DropDown,
Formatter = new CustomFormatter(){FormatFunction = ""}
},
new JQGridColumn
{
DataField = "Date",
SearchType = SearchType.DatePicker,
DataType = typeof (DateTime),
SearchControlID = "DatePicker",
SearchToolBarOperation = SearchOperation.IsEqualTo,
Editable = false,
},
new JQGridColumn
{
DataField = "Yield",
Editable = false,
},
new JQGridColumn
{
DataField = "Credit",
Editable = false
},
new JQGridColumn
{
DataField = "Balance",
Editable = false
},
},
Width = Unit.Pixel(1000),
Height = Unit.Pixel(500)
};
数据:
var joinTransationAndEmployee = employees.Join(transaction, e => e.TimeAccountID, tl => tl.AccountID,
(employee, log) =>
new
{
log.ID,
log.Date,
log.Credit,
log.Yield,
log.Balance,
FirstName= employee.FirstName,
LastName = employee.LastName
});
return model.ResultGrid.DataBind(joinTransationAndEmployee);