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 ?