Scenario/Problem:
You want to create a new column and add it to an existing list or
document library. For example, you might want to add a date column
called Birthday for a contacts list or a choice or lookup column called
Client to a document library so that users can choose which client the
document is about.
Solution:
To add a column to a list or document library, switch to the List
ribbon or the Library ribbon and click the Create Column button in the
Manage Views section of the ribbon, as shown in Figure 1.
FIGURE 7.9 The Create Column button in the List ribbon.
Note
The Create Column option creates a new column
in the list or library but does not let you select from the site columns
that are already set up in the site.
Choosing the Create
Column option opens a dialog where you can define the type of column you
want to add, as well as set the settings on that column (see Figure 2).
FIGURE 2 Creating a new column.
The first choice to make is the name of the
column. Column names must be unique in the list; that is, you can’t have
two columns with the exact same name.
After choosing the name for the column, you must choose the type of the column, as shown in Figure 2.
Numerous types of columns are available, and developers can add to
those types, so you might see more than the built-in types shown in the
figures in this book. Also, creating a new column in that type of list (also known as creating a new question) shows more options than are available for standard list types.
All column types require you to choose a name
for the column. They also allow you to specify the description for the
column and whether the column is required (making the column mandatory
in the list, forcing the user to fill it in when creating or editing an
item). Except for the column type, all options can be modified in the
future. Changing the column type for a column is possible but is limited
to certain column types.
Additionally, each column type can offer
different configuration options for that column. For example, a Single
Line of Text column type has a Maximum Number of Characters setting,
whereas a Multiple Lines of Text column type has a Configuration option
for how many lines it should allow.
Some column types also have an option for more
complex validation settings, under the heading Column Validation. Other columns do not support this type of complex validation.