Thank you...
Select Cases for each column. I'm looking for something that will
"WebMatrix" <WebMatrix@discussions.microsoft.com> wrote in message
news:9A2DDAD3-AFF8-4C4A-9D4C-17F44307A83C@microsoft.com...
> Very good example:
>
http://aspnet.4guysfromrolla.com/articles/012903-1.aspx >
> "DC Gringo" wrote:
>
> > Can someone show me how to turn this into a bi-directional sort allowing
> > ascending and descending using the default datagrid allowsorting
attribute?
> >
> > FYI, Session("source") is an sqldataadapter
> > ------------
> >
> > Protected Sub SortCommand_OnClick(ByVal source As Object, ByVal e As
> > System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles
> > DataGrid2.SortCommand
> >
> >
> > Dim ds As DataSet = GetDataSource()
> > Dim dt As DataTable = ds.Tables(0)
> > dt.DefaultView.Sort = e.SortExpression
> >
> > DataGrid2.DataSource = dt.DefaultView
> > DataGrid2.DataBind()
> >
> > End Sub
> >
> >
> > Protected Function GetDataSource() As DataSet
> >
> > Dim ds As New DataSet
> > Dim da As New SqlDataAdapter
> > da = Session("Source")
> > da.Fill(ds)
> > Return ds
> >
> > End Function
> >
> >
> >