webforms - ASP.NET DropDownList OnItemDataBound -
is there method on <asp:dropdownlist>
equivalent onitemdatabound on repeaters?
the reason want check each value before putting in drop down list.
nothing similar onitemdatabound give item context.there events ondatabound triggered when reaches binding.
your reason asking event enriching row instead filterout, not have helped event.
the best option solve question
the reason want check each value before putting in drop down list.
is thing following pseudo code
this.yourdropdownlist.items.clear(); var lst = new list<listitem>(); var yourcollection= <yourcollection after apply linq conditions check> foreach (var obj in yourcollection) { //loop , add this.yourdropdownlist.items.add(new listitem {text = obj.prop1, value = obj.prop2}); }
Comments
Post a Comment