c# - ASP.NET: Remove specific item in Dropdownlist -



c# - ASP.NET: Remove specific item in Dropdownlist -

i'm doing code time start , time end. did manual coding.

here's illustration gui:

its hh:mm

value hr 00 - 23 minutes 00 - 59

scenario:

my start time 8:00 [8-hour,00-minutes], have autopostback. end time of hr not display 00-07 hr display number 8 23.

here's code:

int _intdiff = _tmrstart - _tmrend; (int x = 0; x <= _intdiff; x++) { dropdownlist3.items.remove(dropdownlist3.items[x]); }

its working displaying wrong output..

here's illustration output:

as can see there, programme removes number 00,02,04,06,08. how can create staring 00 - 07 remove in dropdownlist?

if iterate through forwards first element removed on first iteration 00. on sec iteration sec element removed, no 02 01 has moved first element. need iterate backwards elements removed lastly 1 first. try:

for (int x = _intdiff -1; x > -1; x--) { dropdownlist3.items.remove(dropdownlist3.items[x]); }

c# asp.net

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -