Re: ASP.Net DataGrid Sort event problems

Discussion in 'ASP .Net' started by avnrao, May 13, 2004.

  1. avnrao

    avnrao Guest

    when user filters the data, store the dataset in session (or you can
    directly cast datasource property back to dataset) and use that to sort
    instead of hitting db.

    I dont think you need to hit db for 2 times here. can you post your code to
    understand it better.

    Av.
    "Charles Boyung via .NET 247" <> wrote in message
    news:...
    I am having a problem with the Sort event on a datagrid. Here's the
    situation. I have a SQL stored procedure that has numerous filters that the
    user can select. They can also sort on various columns in both directions,
    which I'm using the DataGrid SortCommand for. The problem that I'm running
    into is that the PostBack Sort event doesn't fire unless the DataGrid is
    bound to a valid Data Source on Page_Load. I don't want to query the data
    twice on the page, once for before the sort and once after, but that's what
    I'm stuck with.

    The only other option that I can come up with is faking the data binding by
    creating a fake DataSet with the same columns that the SP returns and
    binding to that on Page_Load and handling the actual loading of data in the
    OnPreRender function. If I don't do that, then the page doesn't error out,
    it just never runs the Sort event, and my sorting never occurs.

    I'm hoping that someone knows more about the Sort event and can help me
    figure out what is wrong here.

    --------------------------------
    From: Charles Boyung

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>HumzIrN7FUiJIFuyLfKPzQ==</Id>
     
    avnrao, May 13, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?c3Jpbmk=?=

    RE: ASP.Net DataGrid Sort event problems

    =?Utf-8?B?c3Jpbmk=?=, May 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    481
    =?Utf-8?B?c3Jpbmk=?=
    May 13, 2004
  2. =?Utf-8?B?c3Jpbmk=?=

    RE: ASP.Net DataGrid Sort event problems

    =?Utf-8?B?c3Jpbmk=?=, May 13, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    462
    =?Utf-8?B?c3Jpbmk=?=
    May 13, 2004
  3. =?Utf-8?B?dHNhcm5h?=

    RE: ASP.Net DataGrid Sort event problems

    =?Utf-8?B?dHNhcm5h?=, Jun 18, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,564
    =?Utf-8?B?dHNhcm5h?=
    Jun 18, 2004
  4. Fred

    asp.net 1.1 datagrid sort event

    Fred, Jan 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    835
    Anmol
    Jan 9, 2006
  5. Navin
    Replies:
    1
    Views:
    762
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page