0

2つの列を連結する必要があります

名 + 姓。

columnt DisplayName を 1 つ作成する必要があります。

どうやってこれを行うのですか?データ\グリッドを受信するときにこれを行うことはできません

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

0 に答える 0