2
votes

I have created a list in SharePoint 2010, initially had the columns Title, Mobile and Email Id. Then I used a grid view (Visual web part) to display these fields.

Later I changed the field Title to Name and Email Id to Email. I tried accessing these fields in the grid view with new field names, however it doesn't fetch anything, only the old column names are still working. Why?

UPDATE

Of course it is not a SharePoint bug :)

1

1 Answers

1
votes

Every SharePoint column (field) has three names:

  • display name - the name that the end user sees
  • internal name - the name that is used internally for referencing the column programmatically and throughout the database
  • static name - the name that is used by the field type when you create custom fields

When you rename the column, you change the display name. The internal name is set when the column is created and it never changes. Thanks to this, applications don't fail when columns' names get changed and the same code can be used for sites using different languages (display name: Title vs. Titel vs. Tytuł, internal name: always Title).

You posted no code so it's a guess but it seems that your grid view references the columns using their internal names.

More information: SharePoint Internal name, Static name, Display name