String; # in the dropdown
I created my own dropdownfield. I want to show the full names of my contacts. I made a calculated column because not every user filled in their full name, only the first and last. If I want to show items in my dropdown, there will always be a string; # before my cost. Does anyone know how to remove this?
Here is the code where I populate my dropdown menu
SPWeb web = site.OpenWeb();
SPDataSource dataSource = new SPDataSource();
dataSource.List = web.Lists["Contacts"];
this.testing.DataSource = dataSource;
this.testing.DataTextField = "Full Name";
this.testing.DataValueField = "Full Name";
this.testing.DataBind();
THH
a source to share
The field type is probably "User" (I think it shows up as "People" in the UI). This and other search fields are always stored this way by SharePoint. The value component is the user ID and the string component is the username.
You can use Regex to separate components. You can also specify a SPFieldUserValue that is "correct" and use the properties of this class to retrieve the information.
a source to share
Assuming the fully qualified name is a text field, it looks like you have a computed column definition error that one of your inputs is a search field.
If you can't get rid of it in a cleaner way, there is always substr (or maybe correct, I will never remember the syntax of excel functions)
a source to share