Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/03/2005, 08:05
mjesus20
 
Fecha de Ingreso: marzo-2005
Mensajes: 190
Antigüedad: 19 años, 3 meses
Puntos: 0
Exclamación ascendente y descendente del datagrid

hola a todos tengo el siguiente codigo para ordenar mi datagrid pero me arroja un error alguien me podria indicar que tengo mal puesto en mi codigo

Sub suborden(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEvent Args)

Dim dv As New System.Data.DataView()

Dim strorden As String

dv.Table = MyQueryMethod(IIf((campoitem.Text = ""), "", DropDownList2.SelectedItem.Text)).Tables(0)


dim aux() as string
dim tipoSort as String =" "

aux=split(e.sortExpression, " ")

if aux(1).lengh<1 then
tipoSort="ASC"
else
if aux(1).tostring="ASC" then
tipoSort="DESC"
else
tipoSort="ASC"
end if

end if

dv.Sort = e.SortExpression+" "+tipoSort
e.SortExpression= e.sortExpression+" "+tipoSort

DataGrid1.DataSource = dv

DataGrid1.DataBind()

campoorden.Text = e.SortExpression + strorden

End Sub