class obj { int typeId; //10 types 0-9 string uniqueString; //this is unique }
Assume there is list with 100 elements of obj, but only 10
I wanted to bind a particular data to dropdown and it should be distinct. I did the following:
List classDetails; List classDetailsData = classDetails.Select(dt => dt.Data).Distinct.ToList(); ddlData.DataSource = classDetailsData; ddlData.Databind();
See if it helps