kendo-ui – 如何使用它的ASP MVC Complete Wrapper设置KendoUI
发布时间:2020-12-16 03:42:04 所属栏目:asp.Net 来源:网络整理
导读:我正在使用KendoUI Grid及其ASP MVC Complete Wrapper库,我在剃刀代码中设置网格高度时出现问题.我尝试设置 HTMLAttribute但似乎不起作用. @(Html.Kendo().GridSoftInn.Data.Country() .Name("grid-countries") .DataSource(datasource = datasource.Ajax()
我正在使用KendoUI Grid及其ASP MVC Complete Wrapper库,我在剃刀代码中设置网格高度时出现问题.我尝试设置
HTMLAttribute但似乎不起作用.
@(Html.Kendo().Grid<SoftInn.Data.Country>() .Name("grid-countries") .DataSource(datasource => datasource.Ajax() .Model(model => model.Id(record => record.Id)) .Create(create => create.Action("Add","Country")) .Read(read => read.Action("GetAll","Country")) .Update(update => update.Action("Update","Country")) .Destroy(delete => delete.Action("Delete","Country")) .Events(events => { events.Sync("gridcountries_synchandler"); events.Error("gridcountries_errorhandler"); }) .PageSize(10) ) .Columns(columns => { columns.Bound(r => r.Name); columns.Bound(r => r.Currency); columns.Bound(r => r.TimeZone); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(170); }) .ToolBar(toolbar => { toolbar.Create().Text("Add New Country"); toolbar.Custom().Text("Refresh").Url("#").HtmlAttributes(new { onclick = "window.refreshGrid($(this).parent().parent())",@class = "customRefreshButton" }); toolbar.Custom().Text("More").Url("#").HtmlAttributes(new { onclick = "window.toggleDisplay($('#grid-countries > .k-grouping-header'))",@class = "customToggleButton float-right" }); } ) .Editable(editable => editable.Mode(GridEditMode.InLine)) .Pageable(pageable => { pageable.Refresh(true); pageable.PageSizes(true); }) .Resizable(resize => resize.Columns(true)) .Reorderable(reorder => reorder.Columns(true)) .Sortable() .Scrollable() .Filterable() .Selectable() .ColumnMenu() .Groupable() .HtmlAttributes(new { Height = "400px"}) ) 解决方法
请尝试以下方法:
.HtmlAttributes(new { style = "height:400px" }) 当前设置不起作用,因为Height不是Kendo Grid正在渲染的DIV元素的有效HTML属性. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ASP.NET Core使用Jaeger实现分布式追踪
- asp.net-web-api – 带有json有效负载中令牌的WebApi授权过
- 单元测试 – 如何对Asp.net核心WebAPI(net452)项目进行单元
- ASP.NET 5未在开发模式下运行
- asp.net – IIS HTTP错误403.1 – 禁止访问:拒绝执行访问
- ASP.NET 判断微信浏览器
- 具有嵌套列表的ASP.NET MVC DefaultModelBinder
- asp.net-mvc – 有条件地在webgrid中显示图像 – mvc 3
- asp.net-mvc – 将HTML.EditorFor转换为下拉列表(html.drop
- .net – 编译器错误消息:编译器失败,错误代码为-532462766
推荐文章
站长推荐
- ASP.NET MVC3 HttpStatusCodeResult StatusDescr
- MVC3 .NET会话随机丢失会话值并返回null
- asp.net-mvc – 我的剃刀视图的自定义基页类型,如
- asp.net-mvc – ASP.NET MVC 6中的文件IO Close(
- asp.net-mvc – 使用自定义ASP.NET MVC IValuePr
- asp.net-mvc – 用静态项绑定Html.DropDownList
- asp.net下创建、查询、修改带名称空间的 XML 文件
- asp.net – 如何在经典的asp中使用.net共享会话?
- 更改ASP.NET网站管理工具连接字符串
- asp.net – 表单身份验证web.config设置
热点阅读