how to sort dropdownlist?

kaisersoze

Centurion
Joined
Aug 27, 2003
Messages
152
Hi
In my app, a dropdownlist is dynamically populated and user can add new list also. everythime user inserts it is appending in the end. Is there a way (property) that sorts automatically.
 
use

DropDownList.Items.Insert(index, NewListItem);

or

DataView dv = new DataView();
//fill dataview
dv.Sort();
DropDownList.DataSource = dv;
DropDownList.DataBind();
 
Back
Top