Are you, like me, also fed up when you are using the SPGridView and lookup values look like this?
And Date (so not the time) values look like this?
And HTML values look like this?
Well.. then just simply create your own class that inherits from SPBoundField class like this!

The code above makes sure that that only the text of the lookup is being displayed. So you won't see the annoying id and the "#" sign anymore. The following snippet is used to enable Full HTML on a field:

Use this snippet that will take an URL fieldvalue into a proper hyperlink, instead of the ‘SharePoint'-way of storing Urls like "http://link","LinkDescription".. .

End result being:

Brilliant stuff, eh? ;)
Now, to get that proper DateTime value without the time and in the regional settings that is currently applied to your SPWeb, head over to the following post by the BitterCoder at Daylight savings not working right for SPGridView! Also Ryan McIntyre has a similar post on adding the ‘new' icon to your items in the grid: Display New Icon in SPGridView.
Posted
Nov 07 2008, 11:10 AM
by
Robin Meure