Telerik MVC网格行值在分组后失败

时间:2014-03-17 12:18:45

标签: jquery asp.net-mvc telerik telerik-grid

我认为我有Telerik MVC网格。

enter image description here

我绑定了该列"借方余额"我的客户端计算值和数据绑定正确,这是我如何绑定数据

//my grid
    @( Html.Telerik().Grid<Orpac.Models.E_GetCarHar_Result>()
                     .Name("grdAccTransactions").NoRecordsTemplate("No record to display")
                     .Localizable("")

                     .HtmlAttributes("width: 100%;cellpadding:0;")
                     .Columns(columns =>
                     {
                         columns.Bound(e => e.CrhIdent).Hidden().IncludeInContextMenu(false);
                         columns.Bound(e => e.CrhTip).Hidden().IncludeInContextMenu(false);
                         columns.Bound(e => e.CrhTarih).Title((string)ViewData["Date"]);
                         columns.Bound(e => e.CrhTipNam).Title((string)ViewData["Description"]);
                         columns.Bound(e => e.CrhRef).Title((string)ViewData["Ref"]);
                         columns.Bound(e => e.CrhIslem).Hidden().IncludeInContextMenu(false);
                         columns.Bound(e => e.CrhDvzTut).Title((string)ViewData["Amount"]);
                         columns.Bound(e => e.CrhYrlTut).Title((string)ViewData["DebitBalance"]);
                         columns.Bound(e => e.CrhVade).Title((string)ViewData["DueDate"]);
                     })                 
                     .DataBinding(d => d.Ajax().Select("GridAccountTransactionBinding", "Transaction"))
                     .ClientEvents(events => events.OnRowDataBound("onRowDataBoundAccTrans").OnLoad("onloadaccountTR").OnRowSelect("onRowSelectaccountTR"))
                     .Selectable()
                     .Sortable()
                     .Pageable(paging => paging.Enabled((bool)ViewData["paging"]).PageSize(10))
                     .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
                     .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
                     .Footer(((bool)ViewData["showFooter"]))
                     .Scrollable(scrolling => scrolling.Height(330))
                     .Resizable(config =>
                     {
                         config.Columns(true);
                     })
                     .Reorderable(config =>
                     {
                         config.Columns(true);
                     })
                    .ColumnContextMenu()
                   )
//this is how to bind grid


    [GridAction(GridName = "grdAccTransactions")]
    public ActionResult GridAccountTransactionBinding()
    {
                    E_Get_Result p = new E_Get_Result();
                    p.CrhIdent = item.CrhIdent;
                    p.CrhTarih = item.CrhTarih;
                    p.CrhVade = item.CrhVade;
                    p.CrhRef = item.CrhRef;
                    p.CrhIslem = item.CrhIslem;
                     if (p.CrhIslem == "-")
                    {
                        p.CrhDvzTut = item.CrhDvzTut;
                        p.CrhYrlTut = DebitBalance - item.CrhDvzTut;
                    }
                    else
                    {
                        p.CrhDvzTut = (-1)*item.CrhDvzTut;
                        p.CrhYrlTut = DebitBalance + item.CrhDvzTut;
                    }
                    p.Add(list);

        return View(new GridModel<Models.E_GetCarHar_Result>
        {
            Data = list
        });
    }


 //Change DBalance number format in this function
function onRowDataBoundAccTrans(e) {
var decimal = $("#decimal1").text();
var currency = $("#currency1").text();
var dsep = $("#dsep1").text();
var tsep = $("#tsep1").text();
e.row.cells[6].textContent = accounting.formatMoney(e.dataItem.CrhDvzTut, currency, parseInt(decimal), tsep, dsep);
e.row.cells[7].textContent = accounting.formatMoney(e.dataItem.CrhYrlTut, currency,     parseInt(decimal), tsep, dsep);
}

但是当我将任何数据分组时

我的行值绑定而不计算?我可以使用调试器值来获取true,但是网格没有显示相同的值

分组后&#34;借方余额&#34;值显示不计算

enter image description here

你知道这个理由吗?

请帮帮我

Thnx All

1 个答案:

答案 0 :(得分:0)

按操作进行排序或过滤时,您是否也遇到问题?