ASP.NET 2.0 sort DataList without query again

Discussion in 'ASP .Net Web Controls' started by hohans@yahoo.com, Jan 7, 2006.

  1. Guest

    Hi All,

    In 2.0, how do you sort DataList without executing the query again?

    So far what I found in the Web all show examples where you need to
    re-execute the query against DB with passed in field name and sort
    direction. The data source has been bound to the control. Can we
    somehow just retrieve it, sort it and bind it again? Any ideas will be
    truely appreciated.

    Hans
     
    , Jan 7, 2006
    #1
    1. Advertising

  2. Guest

    Yes, I just posted something similiar and would like to know.
     
    , Jan 8, 2006
    #2
    1. Advertising

  3. Guest

    Anyone??
     
    , Jan 8, 2006
    #3
  4. Axel Dahmen Guest

    Hi Hans,

    actually what happens when you bind a data control do a data source is that
    it reads the data contained in the data source and creates html from it when
    you call the DataBind() function. It doesn't store the data source any
    further than that.

    The syntax is a bit confusing, I must admit. It would have been simpler to
    understand if there wasn't a DataSource property and if the DataBind()
    function had the data source as its sole parameter, like
    "DataBind(myDTable);".

    HTH,
    www.sportbootcharter.com
    Axel Dahmen


    ---------------
    <> schrieb im Newsbeitrag
    news:...
    > Hi All,
    >
    > In 2.0, how do you sort DataList without executing the query again?
    >
    > So far what I found in the Web all show examples where you need to
    > re-execute the query against DB with passed in field name and sort
    > direction. The data source has been bound to the control. Can we
    > somehow just retrieve it, sort it and bind it again? Any ideas will be
    > truely appreciated.
    >
    > Hans
    >
     
    Axel Dahmen, Jan 9, 2006
    #4
  5. Guest

    Hi Axel

    or anyone who would like to give input:

    If the data source bound to a control is just for reading, then how
    does it maintain view state? Remeber when EnabledViewState is true, it
    is supposed to (actually it does do) display the same data accross page
    postback, right?

    Hans
     
    , Jan 9, 2006
    #5
    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. Nevyn Twyll
    Replies:
    8
    Views:
    1,882
  2. VB Programmer
    Replies:
    1
    Views:
    1,251
    S. Justin Gengo [MCP]
    Jan 27, 2006
  3. Navin
    Replies:
    1
    Views:
    705
    Ken Schaefer
    Sep 9, 2003
  4. Replies:
    9
    Views:
    416
    whisperjim
    Nov 27, 2008
  5. Replies:
    0
    Views:
    261
Loading...

Share This Page