html - web Grid 列传递样式类

标签 html css asp.net-mvc webgrid mvcgrid

我已经定义了我的网格列,如下所示,

WebGridColumn colRequestorEmail= new WebGridColumn();
colRequestorEmail.ColumnName = "RequestorEmail";
colRequestorEmail.Header = "Requestor Email Id";
colRequestorEmail.CanSort = true;
colRequestorEmail.Style = "name";

和我的 CSS 如下,

.name { width: 0px;visibility: hidden; }

我仍然能够看到我想传递的列是隐藏的吗?

最佳答案

您在这里添加一个 css 名称并使用您的 css 文件设置实际属性

  // Summary:
    //     Gets or sets the CSS class attribute that is rendered as part of the HTML table
    //     cells that are associated with the System.Web.Helpers.WebGrid column.
    //
    // Returns:
    //     The CSS class attribute that is applied to cells that are associated with the
    //     column.

关于html - web Grid 列传递样式类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36152549/

相关文章:

javascript - 使用 javascript 滚动日志文件 (tail -f) 动画

jquery - 根据原始大小更改字体大小

javascript - 多个 HTML 文本区域一起调整大小

css - Spring Boot + Thymeleaf css 不适用于模板

html - 将 html 元素放置在行内

.net - HttpResult(HttpStatusCode.NoContent) 创建响应 "OK"

asp.net-mvc - 在 MVC Razor 中保留数据而不在请求之间使用 TempData

javascript - 如何防止由不属于mvc项目的javascript编写的HttpPost?

javascript - History API - 告诉浏览器保留在index.html上,无论url是什么

javascript - 如何使用 HTML 中的 javascript 打开 html 中的文本并将其保存到文件中