Hi,
I have posted in my last thread for dropdown list sort
http://forums.asp.net/t/1913754.aspx/1?Sort+Dropdown+List+Item+Binded+Through+Command+Object
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
DataSet dataSource = new DataSet();
try
{
cmd = new SqlCommand("MyProcedure", con);
cmd.CommandType = CommandType.StoredProcedure;
da.SelectCommand = cmd;
da.Fill(dataSource);
DataView defaultView = dataSource.Tables[0].DefaultView;
defaultView.Sort = this.TextField + "Asc";
dropDownList.DataSource = defaultView;
dropDownList.DataTextField = "TextField";
dropDownList.DataValueField = "ValueField";
dropDownList.DataBind();
}
catch (Exception x)
{
}
finally
{
}
The above code is working fine. But the sort has some problem, coz my sort is for number
The sort is doing, like th ...
Go to the complete details ...