Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
MyDataView.Sort = "myColumn DESC"
What do you mean you can't sort drop down lists? My above example shows you how to do it with a DataView...I just read where you cant sort drop down box's
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' Declarations
Dim dt As New DataTable
Dim dr As DataRow
Dim rndNo As Integer
' Create a datatable with ten sample records
dt.Columns.Add("Item1")
For i As Integer = 1 To 10
dr = dt.NewRow
Randomize()
rndNo = Int((10 - 1 + 1) * Rnd())
dr("Item1") = CStr(i * rndNo).PadLeft(3, "000")
dt.Rows.Add(dr)
Next
' Create a DataView to sort the random numbers
Dim dv As New DataView
dv = dt.DefaultView
dv.Sort = "Item1 DESC"
' Bind the DropDownList to the DataTable
DropDownList1.DataTextField = "Item1"
DropDownList1.DataValueField = "Item1"
DropDownList1.DataSource = dv
DropDownList1.DataBind()
End Sub