4
votes

I have a custom list template that is deployed as a .wsp. The list has almost 30 columns, including several DropDownLists of column type "Choice". None of the columns are required and the customer wants a blank option as the default selection for each. Unfortunately once the list item has been saved, any columns that have had values selected can no longer be un-selected.

To get around this we added a blank <CHOICE> </CHOICE> element in the schema.xml and event.xml files.

Unfortunately, one of the columns completely ignores the blank choice - acts just the same as I described above (SP default behavior). I have already checked the obvious (to me) things - making sure guids match up, the blank choice exists in both files, etc.

Any other ideas on what I can look into to fix?

3

3 Answers

6
votes

I think I solved this long time issue after a lot of frustration and trial and error. Everyone seems to think that this is not possible by design, but it is in fact quite simple.

Spaces in column choices seem to be wiped by SharePoint, but I found a blank character in the ASCII table that does not get wiped by the SharePoint engines.

This is ASCII Character 0x81 or 0129.

Non-Blank Space (0160) seems to be swiped too

To create a blank character hold down the 'Alt' key and type '0129' on the NUMERIC KEYPAD.

Alternate option: I used PSPAD editor to create a single character 129 and copied and pasted that in one of my choices type columns and presto: a blank selection appeared in the column selector. I suspect it will work for your solution too.

1
votes

There is another option as long as they have the default set to null. Fields where a choice has been selected and they want it as a null value, just go into the library or list, actions, edit in datasheet. Then just manually delete the fields where you want null values and you will be set.

0
votes

There is no way around this behaviour. You will either have to create your own custom field to allow this behaviour, or add a choice with the value "[blank]" as the default (and make the field required).

Not really ideal in either case.