public void SortByActiveDays(ref List <AssessSource> tempMyProjectDetailCollection) { AssessSource[] tempNameListt = new AssessSource[tempMyProjectDetailCollection.Count]; tempNameListt = tempMyProjectDetailCollection.ToArray(); int[] tempstringNameList = new int[tempMyProjectDetailCollection.Count]; for (int i = 0; i < tempMyProjectDetailCollection.Count; i++) { tempstringNameList[i] = tempMyProjectDetailCollection[i].ActiveDays; } Array.Sort(tempstringNameList, tempNameListt); tempMyProjectDetailCollection.Clear(); tempMyProjectDetailCollection = tempNameListt.ToList(); }
public void SortByDep() { AssessSource[] tempNameListt = new AssessSource[AssessSourcecollection.Count]; tempNameListt = AssessSourcecollection.ToArray(); string[] tempstringNameList = new string[AssessSourcecollection.Count]; for (int i = 0; i < AssessSourcecollection.Count; i++) { tempstringNameList[i] = AssessSourcecollection[i].CompanyInfo; } Array.Sort(tempstringNameList, tempNameListt); AssessSourcecollection.Clear(); AssessSourcecollection = tempNameListt.ToList(); }