我已经定义了我的网格列,如下所示,
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/