I'm new to C# and I'm having a little trouble sorting a dropdown list that's bound to a SharePoint list. The dropdown seems to be ordered by the created date of each item in the sharepoint list, I need it sorted by title. Whats the easiest way to do this?
Thanks!
protected void Page_Init(object sender, EventArgs e)
{
SPList list = SPContext.Current.Web.Lists["Services"];
//DataTable dt = list.Items.GetDataTable();
//dt.Rows.
DropDownList2.DataSource = list.Items.GetDataTable();
DropDownList2.DataTextField = "Title";
DropDownList2.DataBind();
Image1.Visible = false;
DropDownList2.AppendDataBoundItems = true;
this.DropDownList2.Items.Insert(0, "-Select-");
}