I have an idea where I need to determine if a property is decorated with hidden input.
My property is defined as:
[HiddenInput(DisplayValue = false)]
public string UserName{ get; set; }
My attempt so far has been:
var column.Member = "UserName";
if (ViewData.ModelMetadata.HideSurroundingHtml == true &&
ViewData.Values.Contains(column.Member))
{
column.Visible = false;
}
I read that I could use "HideSurroundingHtml" to determine if a property should be displayed.
Any ideas how to detect this?
source
share