Z
Zamdrist
It's my understanding, in order to sort a datagrid you have to create a
new DataTable, correct?
So, if on the load of the page, you do something like this:
'adosDS & AdoConn are global in this instance
Dim adoSelect As New SqlCommand
Dim adoDa As New SqlDataAdapter
adoSelect.CommandType = CommandType.StoredProcedure
adoSelect.CommandText = "MG_SelectTMLSAssignments"
adoSelect.Connection = adoConn
adoDa.SelectCommand = adoSelect
adoDa.Fill(adoDS, "Assignments")
dgTMLSAssignments.DataSource = adoDS.Tables("Assignments").DefaultView
dgTMLSAssignments.DataBind()
You'd have to do the same thing essentially over again, in the
SortCommand event of the datagrid, correct?
The ASP.Net tutorial here:
http://www.asp.net/QuickStart/howto/doc/adoplus/FilterData.aspx says
you need only create a new dataview and set the Sort property, this
however doesn't work, generating the error: DataTable must be set prior
to using DataView
So...either I just don't get it, or Microsoft's example is incomplete
and/or erroneous.
new DataTable, correct?
So, if on the load of the page, you do something like this:
'adosDS & AdoConn are global in this instance
Dim adoSelect As New SqlCommand
Dim adoDa As New SqlDataAdapter
adoSelect.CommandType = CommandType.StoredProcedure
adoSelect.CommandText = "MG_SelectTMLSAssignments"
adoSelect.Connection = adoConn
adoDa.SelectCommand = adoSelect
adoDa.Fill(adoDS, "Assignments")
dgTMLSAssignments.DataSource = adoDS.Tables("Assignments").DefaultView
dgTMLSAssignments.DataBind()
You'd have to do the same thing essentially over again, in the
SortCommand event of the datagrid, correct?
The ASP.Net tutorial here:
http://www.asp.net/QuickStart/howto/doc/adoplus/FilterData.aspx says
you need only create a new dataview and set the Sort property, this
however doesn't work, generating the error: DataTable must be set prior
to using DataView
So...either I just don't get it, or Microsoft's example is incomplete
and/or erroneous.