Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Depends on the view I need to get the column name from the list.With the help of viewID I am able to retrieve the selected column from the list but I have an issue while retrieving the column names,I have written the code like this.

SPView currentlistview = currentList.GetView(viewID);


  foreach (string viewField in currentlistview.ViewFields)
  {
     string colname = currentList.Fields.GetField(viewField).Title;
     string colTitle = currentList.Fields.GetFieldByInternalName(viewField);
  } 

I have tried both the possibilities but I am getting the internal name of the field in the list.Could anyone provide a solution to get the display name of the field ?

share|improve this question
    
SPField.Title is the display name. Have you created strange names for the columns? –  James Love Jun 7 '11 at 16:40
add comment

1 Answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.