我定义了我的网格列如下

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网格列以传递样式类,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36152549/

10-13 03:19