c# - How to bind array to dropdownlist with condition -


this might duplicate question, not able find helpful answer query.

i have array of class leveldetails getting web service. each array item has property named "level". every employee has level assigned him. if level value 3, need bind dropdownlist array items having level less 3.

i know how bind dropdownlist array. not able figure out how specify condition.

        list<bo.testclass> list = new list<bo.testclass>();          bo.testclass c1 = new bo.testclass();         c1.level = 4;         list.add(c1);          bo.testclass c2 = new bo.testclass();         c2.level = 3;         list.add(c2);          bo.testclass c3 = new bo.testclass();         c3.level = 9;         list.add(c3);          bo.testclass c4 = new bo.testclass();         c4.level = 2;         list.add(c4);          bo.testclass c5 = new bo.testclass();         c5.level = 1;         list.add(c5);          bo.testclass c6 = new bo.testclass();         c6.level = 8;         list.add(c6);          list<bo.testclass> test = list.where(x => x.level > 3).tolist(); 

if understand need this. after bind test dropdownlist.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -