I am using an ASP.net gridview. The datasource is SPList.Items.GetDataTable().
The gridview is working fine; however, lookup and multilookup columns display as "id;#value". Is there any way to just show the value?
Here is how I solved this issue:
Make sure declare
Alternatively, you could use SPFieldLookupValue (for a single lookup) and SPFieldLookupValueCollection (for a multi-lookup) to parse the field values using SharePoint's built-in methods for processing them.
Here is a revised version of your function for single lookups:
I've also turned the parameter into a
Details on processing multiple lookups (and more) can be found in my blog article: