JQGrid如何连续两列?

时间:2012-12-04 14:11:07

标签: c# asp.net-mvc jqgrid

我需要conccat两列

FirstName + LastName。

我需要创建一个columnt DisplayName。

这是怎么回事? 接收数据时我不能这样做 \ grid

 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);

0 个答案:

没有答案