web Grid column to pass style class

641 Views Asked by At

I have defined my grid column as below,

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

and my CSS as below,

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

I am still able to see the column that I want to pass as hidden?

1

There are 1 best solutions below

0
Shawn P Farmer On

you add a css name here and set the actual attribute with your css file

  // 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.