Probably the best way to achieve it is to create your own template for your data type. One of possible solutions is to add ShortUrl.asxc
or ShortUrl.cshtml
to Shared\DisplayTemplates
folder:
@model string
@Model.Substring(20)
And then change your field definition to:
[Required()]
[DataType(DataType.Url)]
[DisplayFormat(DataFormatString = "{0,20}")]
[UIHint("ShortUrl")]
public string Link { get; set; }
or provide template name in a view:
@Html.DisplayFor(m => m.Link, "ShortUrl")
Of course you could extend your display template to use metadata and check for nulls etc.,