Guest User

Untitled

a guest
May 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. int count = DropDownList.Items.Count - 1;
  2. for (int i = count; i > 0; i--)
  3. DropDownList.Items.RemoveAt(i);
  4.  
  5. var listItem = DropDownList.Items[0];
  6.  
  7. DropDownList.Items.Clear();
  8.  
  9.  
  10. DropDownList.Items.Add(listItem);
Add Comment
Please, Sign In to add comment