-1

How to prevent duplicates data in resource file (.resx) from combobox selection

like:

apple
mango
mango
apple
mango
grapes

combo-box creating duplicates value, when ever user enter the records in resx file, and select that that combo-box to verify whether the values were saved or not

JAL
  • 41,701
  • 23
  • 172
  • 300
VIVEK
  • 257
  • 1
  • 5
  • 18
  • Please, give some more information. [http://stackoverflow.com/help/how-to-ask](http://stackoverflow.com/help/how-to-ask) – Fabio Jan 12 '16 at 07:33
  • I still can't understand how you can have duplicates in resx file, since keys cannot be duplicated. Can you post an example of how you load resources into combobox? – LucaMus Jan 12 '16 at 09:48

1 Answers1

0

Before Adding items into Combobox. Make List of that strings. And use

var filtered = ResourcesList.Distinct().ToList();

and you have get apple mango grapes in your filtered list. After it add items to combobox.