Today I am coming with a small but efficient code for performing Sort operation in List
self understandable.
List
braList = _branManager.GetBranchList();
braList.Sort
(
delegate(Branch braA, Branch braB)
{
if (CompanySortDirection == SortDirection.Ascending)
{
return braA.BranchCode.CompareTo(braB
}
else// if (CompanySortDirection == SortDirection.Descending)
{
return braB.BranchCode.CompareTo(braA
}
}
);
Depending upon the Sort Direction the list get sorted.
No comments:
Post a Comment