Justin Waugh
Justin Waugh

Reputation: 21

SharePoint Custom Fields In List View

I've got a requirement to hold a DateTime value in a SharePoint field but to customise the display in a list view so that it shows as a mmmm string. The underlying value must remain as the DateTime so the sort is chronological rather than alphabetical.

So I think that a Custom Field is the way to go, I'll also get some added benefit in restricting the user interface to a month picker so even if there is another solution I'll likely go down this route to get that.

I've read that I can apply custom templates to the new, edit and display actions but I can't seem to find anything saying how to alter the list view (display patterns doesn't seem to be enough).

Anyone got any ideas?

Thanks

Justin

Upvotes: 1

Views: 1587

Answers (2)

Justin Waugh
Justin Waugh

Reputation: 21

Ended up using a bit of an ugly series of <IfSubString> within the RenderPattern...

Upvotes: 1

Johan Leino
Johan Leino

Reputation: 3533

I dont know if this is what you are looking for but I have used a solution with a custom fieldcontrol that overrides RenderFieldForDisplay like:

protected override void  RenderFieldForDisplay(HtmlTextWriter output)

This is a similar post:

How to manage column based access control in Sharepoint lists?

Upvotes: 1

Related Questions