2

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 ?

James Love
  • 25,512
  • 2
  • 45
  • 77
Ramalingam
  • 325
  • 6
  • 18

1 Answers1

1

you should check this post

Finding the internal name and display name for a list column

Hope it helps