[Solved] how can we sort the list items in drop down list in asp.net programatically [closed]


First take a DataTable to put the data of The Dataset

DataTable table = dataSet.Tables[0];

and then
you can create a DataView of your Datatable and then bind the drop down list to that. Your code will be like this then

DataView dvlist = new DataView(table);
dvlist.Sort = "Description";

ddllist.DataSource = dvlist;
ddllist.DataTextField = "Description";
ddllist.DataValueField = "Id";
ddllist.DataBind();

hope you find your solution now

3

solved how can we sort the list items in drop down list in asp.net programatically [closed]