Home All Groups Group Topic Archive Search About

Cause GridView to be sorted from DropDownList

Author
23 Feb 2007 1:37 AM
DBLWizard
Howdy All,

I have a GridView control on a page and I want to give the user the
ability to sort using the colums or using a dropdown.  Is there an
easy way to tell the grid to sort based on a column?  Or do I have to
manually sort the datasource and rebind it to the grid?

Thanks

dbl

Author
25 Feb 2007 8:20 PM
Teemu Keiski
Yes, sorting involves binding the grid with data in the sorted order.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net



Show quoteHide quote
"DBLWizard" <ibflyfis***@yahoo.com> wrote in message
news:1172194651.274459.157550@v33g2000cwv.googlegroups.com...
> Howdy All,
>
> I have a GridView control on a page and I want to give the user the
> ability to sort using the colums or using a dropdown.  Is there an
> easy way to tell the grid to sort based on a column?  Or do I have to
> manually sort the datasource and rebind it to the grid?
>
> Thanks
>
> dbl
>
Are all your drivers up to date? click for free checkup

Author
26 Feb 2007 6:12 PM
DBLWizard
Teemu,

My situation is that the grid has sorting turned on and sorting works
fine.  But my client also wants to be able to sort from a drop down.
I was hoping that there was some event on the grid that I could call
and pass the column that sorting is wanted on.

What you are saying is that I will have to manually sort the
datasource and then rebind?

Show quoteHide quote
On Feb 25, 1:20 pm, "Teemu Keiski" <jot***@aspalliance.com> wrote:
> Yes, sorting involves binding the grid with data in the sorted order.
>
> --
> Teemu Keiski
> AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net
>
> "DBLWizard" <ibflyfis***@yahoo.com> wrote in message
>
> news:1172194651.274459.157550@v33g2000cwv.googlegroups.com...
>
>
>
> > Howdy All,
>
> > I have a GridView control on a page and I want to give the user the
> > ability to sort using the colums or using a dropdown.  Is there an
> > easy way to tell the grid to sort based on a column?  Or do I have to
> > manually sort the datasource and rebind it to the grid?
>
> > Thanks
>
> > dbl- Hide quoted text -
>
> - Show quoted text -

Bookmark and Share