VisibleAttribute [Common]

Estrusco edited this page Sep 26, 2016 · 2 revisions
Clone this wiki locally

[namespace: Serenity.ComponentModel] - [assembly: Serenity.Core]

This attribute can be used to make visible or invisible a field. This attribute is applicable on entity row, colunms or form level.

// This make invisible the field in column and in form
public class CustomerRow : Row
{
   [Visible(false)]
   public string StreetAddress
   {
      get { return Fields.StreetAddress[this]; }
      set { Fields.StreetAddress[this] = value; }
   }
}

or

// This make invisible the field only in column 
public class CustomerColumns
{
   [Visible(false)]
   public string StreetAddress { get; set; }

or

// This kae invisible the field only in form
public class CustomerForm
{
   [Visible(false)]
   public string StreetAddress { get; set; }

See also: