I want to display items in a dropdownlist like 5%, 10%, 15%, 20% until 100. Is there a way to bind an intelligent LINQ query to the datasource that will do this for me?
You can use Enumerable.Range:
Enumerable.Range(1, 20).Select(x => 5 * x);
Or, in a more LINQ-like syntax:
from x in Enumerable.Range(1, 20)
select (x * 5);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With