css - 带有 CSS 引用的 Kendo UI 网格

标签 css kendo-grid

我正在尝试编写必须符合某些规则的代码。目前我正在研究一个看起来有点像这样的部分:

<head><link rel="stylesheet" href="Site.css"></head>

<div class="row">
    <div class="col-md-12">    
       @(Html.Kendo()
         .Grid<ViewModel>()
         .Name("currentGrid")
         .HtmlAttributes(new { style = "width: 100%; height: 640px;", @class = "gridMenu" }))
    </div>
</div>

这确实可以正常工作,但我正在定义一种新样式这一事实让我很困扰。有什么办法可以使这个引用成为 css 文件中的样式吗?所以不是

.HtmlAttributes(new {style = ...

有点像

.HtmlAttributes(id = currentGrid

currentGrid 是 css 文件中的 id 或 class。

我们非常欢迎任何帮助或问题。

最佳答案

你很接近。您可以为 GridId 添加 css

#currentGrid{
 width: 100%;
 height: 640px;
}

或者

您可以添加一个类并为该类添加样式。以下语句为现有网格添加一个新类。

.HtmlAttributes(new {@class = "gridmenu"})

.gridmenu{
 width: 100%;
 height: 640px;
}

关于css - 带有 CSS 引用的 Kendo UI 网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50743739/

相关文章:

css - 无法单击透明 div 下方的链接(在 FireFox 或 IE 中)

html - 为 .each 循环中的一个条目显示带有表显示值的模态

javascript - 基于 bool 值的 Kendo 网格过滤器

javascript - 来自网格的列数组的 Kendo UI 动态详细信息模板

javascript - AngularJS - Kendo UI 应用程序在 "Evaluate Script"中花费很长时间

javascript - MVC4 中的 Kendo UI 网格单元格着色

html - 为什么会这样? HTML 窗口宽度

html - 在现有网站上方添加标题

javascript - 剑道 ui 网格 excel 类行为

html - Bootstrap 正在固定标题中的高度