"Alvin Bruney" <vapor at steaming post office> wrote in message news:<>...
> that code should work, what problems are you seeing?
>
> --
> Regards,
> Alvin Bruney
> Got tidbits? Get it here...
> http://tinyurl.com/2bz4t
> "Dan" <> wrote in message
> news: om...
> > Seems like i've tried every example in the newsgroups and in
> > referenced articles but I just can't get this grid to sort, am I
> > missing something obvious?
> >
> > View State = True
> > Allow Sorting = True
> > Sort Expressions in Property Builder set to Column Names
> >
> > Code for Sort Command:
> >
> > Private Sub DataGrid1_SortCommand(ByVal source As Object, ByVal e
> > As System.Web.UI.WebControls.DataGridSortCommandEvent Args) Handles
> > DataGrid1.SortCommand
> >
> > Dim dv As New DataView(GridSet1.Tables("driverstatus_a"))
> >
> > dv.Sort = e.SortExpression
> >
> > DataGrid1.DataSource = dv
> > DataGrid1.DataBind()
> >
> >
> > End Sub
> >
> > Any help is appreciated
> > Dan
> >
Found the problem, courtesy of DataGrid Girl:
"In your ASPX, in the <asp

atagrid declaration you've
got this:
DataSource="<%# GridSet1 %>"
Any Datagrid properties set declaratively will
override the ones you set in code, so when you set the DataSource to
the filtered DataView, it's not ever taking effect. Take this
property out of the declaration, and in your Page_Load, add a line to
set the DataSource to your GridSet1."
After I eliminated this code in the aspx, it worked fine. This is a
'gotcha', because VStudio automatically put this line in the aspx file
when it built the page - and I was on a wild goose chase thinking the
problem had to be in the vb code....
Thanks to all. Thank you datagrid girl.