Question: I have class like

```
public class ProgressBars
{
    public ProgressBars()
    { }
    private Int32 _ID;
    private string _Name;
    public virtual Int32 ID {get { return _ID; } set { _ID = value; } }
    public virtual string Name { get { return _Name; } set { _Name = value; }}
}

```

here is List collection

```
List<ProgressBars> progress;
progress.Sort //I need to get sort here by Name

```

how can I sort this collection by Name?

Thanks

Answer: 
Related questions:

* [linq Order By for a List(Of myObjects)](https://stackoverflow.com/questions/606997/linq-order-by-for-a-listof-myobjects)
* [Sorting a list using Lambda/Linq to objects](https://stackoverflow.com/questions/722868/sorting-a-list-using-lambda-linq-to-objects)
Implement Icomparable interface and ur done 

public class ProgressBars : IComparable

{

```
    public ProgressBars()
    { }
    private Int32 _ID;
    private string _Name;
    public virtual Int32 ID { get { return _ID; } set { _ID = value; } }
    public virtual string Name { get { return _Name; } set { _Name = value; } }

    public int CompareTo(ProgressBars obj)
    {
        return _Name.CompareTo(obj.Name);
    }        
} 

```