I have Document library which has Document Content type and a Column named Engagement , whose values are populated from term store.
Engagement Column value:
Now my requirement is to group all records by Engagement Column value
My ref code: //Column Field Name private string _EI_Field_Name = "Engagement_x0020_and_x0020_Inclusion_x0020_Document"; List listItems = list.Items.Cast().ToList(); if (listItems.Count > 0) { var groupedItems = listItems.GroupBy(a => a[_EI_Field_Name]).ToDictionary(g=>g.Key);
foreach (var groupItem in groupedItems) { foreach (var groupValue in groupItem) {
} } }