私は剣道グリッドを IE8 内に適切に配置しようと試みてきました (プログラムを使用している人々は Windows XP で立ち往生しています)。IE9、Firefox、Chrome で問題なく動作します。
これが私が使用しているコードです。
私のcshtmlファイル
<!DOCTYPE html>
@model IEnumerable<SymPro.ViewModels.InvestViewModel>
@{
ViewBag.Title = "List Accounts";
}
<p>
@Html.ActionLink("Create New", "Create")
</p>
<font size ="1">
@(Html.Kendo().Grid<SymPro.ViewModels.InvestViewModel>()
.Name("gridInvest")
.Columns(columns =>
{
columns.Bound(p => p.asset_num).Title("Invest. <br/> No.");
columns.Bound(p => p.cusipnum).Title("Security <br/> ID").Width(80);
columns.Bound(p => p.rempar).Title("Remaining <br/> Par").Format("{0:0.00}").Width(100);
columns.Bound(p => p.issuer).Title("Issuer");
columns.Bound(p => p.purdate).Title("Purchased").Width(100);
columns.Bound(p => p.maturdate).Title("Mature/Sell").Width(100);
columns.Bound(p => p.invtype).Title("Type");
columns.Bound(p => p.fund_num).Title("Fund");
columns.Bound(p => p.nomrate).Title("Rate").Format("{0:0.00}");
columns.Bound(p => p.facevalue).Title("Par <br/> Value").Format("{0:0.00}");
columns.Bound(p => p.groupcd).Title("Group");
columns.Bound(p => p.sectorcd).Title("Sector");
columns.Bound(p => p.identity_column).Title("")
.ClientTemplate(@Html.ActionLink("Details", "Details", new { id = "#= identity_column#" }, new { style = "color:blue" })
.ToHtmlString()
);
columns.Bound(p => p.identity_column).Title("")
.ClientTemplate(@Html.ActionLink("Edit", "Edit", new { id = "#= identity_column#" }, new { style = "color:blue" })
.ToHtmlString()
);
columns.Bound(p => p.identity_column).Title("")
.ClientTemplate(@Html.ActionLink("Delete", "Delete", new { id = "#= identity_column#" }, new { style = "color:blue" })
.ToHtmlString()
);
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Invest_Read", "Invest"))
)
.Sortable()
.Scrollable(scr=>scr.Height(450))
)
</font>
私の Invest_Read アクションの結果
public ActionResult Invest_Read([DataSourceRequest]DataSourceRequest request)
{
decimal initzero = 0000000000000.00M;
string initcode = "";
string DefPublCd = "";
var dbAgencyQuery = (from d in db.dbagency
select d).FirstOrDefault();
if (dbAgencyQuery != null)
{
DefPublCd = dbAgencyQuery.defpublcd;
}
DateTime general = new DateTime(1900, 1, 1);
DateTime? empty = null;
var accounts = (from i in db.invest
join s in db.dbsumcalcs on i.asset_num equals s.asset_num into i_s
from subi_s in i_s.DefaultIfEmpty()
join f in db.fisectasgn on i.ficspkey equals f.cspkey into i_f
from subi_f in i_f.DefaultIfEmpty()
join e in db.sector on subi_f.syseckey equals e.syseckey into f_e
from subf_e in f_e.DefaultIfEmpty()
where subf_e.publcd == DefPublCd
orderby i.maturdate
select new InvestViewModel
{
asset_num = i.asset_num,
cusipnum = i.cusipnum,
rempar = (subi_s == null ? initzero : subi_s.rempar),
issuer = i.issuer,
purdate = (i.maturdate == general || i.maturdate == DateTime.MinValue ? empty : i.purdate),
maturdate = (i.maturdate == general || i.maturdate == DateTime.MinValue ? empty : i.maturdate),
invtype = i.invtype,
fund_num = i.fund_num,
nomrate = i.nomrate,
facevalue = i.facevalue,
creditcode = (subi_s == null ? initcode : subi_s.creditcode),
credrte2 = (subi_s == null ? initcode : subi_s.credrte2),
groupcd = (subf_e == null ? initcode : subf_e.groupcd),
sectorcd = (subf_e == null ? initcode : subf_e.sectorcd),
identity_column = i.identity_column
});
DataSourceResult result = accounts.ToDataSourceResult(request);
return Json(result, JsonRequestBehavior.AllowGet);
}