Gridview, using Callbacks when Sorting and Paging

Discussion in 'ASP .Net Web Controls' started by ck388, Jun 6, 2005.

  1. ck388

    ck388 Guest

    For some reason when I enable the callback feature of the gridview I
    still get a page refresh, that is it seems like there is a postback
    that occurs, not a callback which is just supposed to update not the
    whole page, but a portion of the page.

    Strangely enough the URL below

    http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.aspx

    (VB GridView Paging and Sorting Callbacks example)

    has a callback example for gridview which explains that there should
    NOT be a page refresh, but it sure seems like the page refreshes
    (flickers) when I run the example.

    Also another example I found on the web on msdn

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/GrdDetView.asp
    (Listing 4. Using Callbacks when Sorting and Paging section)

    states that...

    <snipp>
    Client-Side Sorting and Paging
    The GridView control provides you with the option of sorting and paging
    records without requiring a form-post back to the Web server. In other
    words, you can re-render the contents of a GridView when sorting and
    paging, without needing to re-render the entire page.

    You enable client paging and sorting by assigning the value true to the
    EnableSortingAndPagingCallback property. When this property has the
    value true, the GridView uses JavaScript to request an updated set of
    records from the Web server.
    <snipp>

    I tried the piece of code that was provided...

    <html>
    <head runat="server">
    <title>Callback GridView</title>
    </head>
    <body>
    <form runat="server">

    <%=DateTime.Now %>

    <asp:GridView
    DataSourceID="TitlesSource"
    EnableSortingAndPagingCallbacks="true"
    AllowPaging="true"
    AllowSorting="true"
    Runat="Server" />

    <asp:SqlDataSource
    ID="TitlesSource"
    ConnectionString=
    "Server=localhost;Database=pubs;Trusted_Connection=true"
    SelectCommand="SELECT * FROM Titles"
    Runat="Server" />
    </form>
    </body>
    </html>

    but even though sorting and paging callbacks are ENABLED, the TIME
    which is NOT supposed to be updated, still gets updated everytime I do
    a sort or change the page.

    Does anyone have any idea why this is happening? Am I misunderstanding
    the whole concept of callbacks? I made sure I am using the 2.0
    framework and using ASP.NET 2.0, just because I installed Visual Studio
    2005 on top of my existing Visual Studio 2003.

    This sucks...I hope someone can shed some light for me into this.

    Thanks for your time and help in advance.

    Best Regards,

    Tim :)
     
    ck388, Jun 6, 2005
    #1
    1. Advertising

  2. ck388

    Brock Allen Guest

    It's broken in the beta 2 bits and will be fixed in RTM.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > For some reason when I enable the callback feature of the gridview I
    > still get a page refresh, that is it seems like there is a postback
    > that occurs, not a callback which is just supposed to update not the
    > whole page, but a portion of the page.
    >
    > Strangely enough the URL below
    >
    > http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.asp
    > x
    >
    > (VB GridView Paging and Sorting Callbacks example)
    >
    > has a callback example for gridview which explains that there should
    > NOT be a page refresh, but it sure seems like the page refreshes
    > (flickers) when I run the example.
    >
    > Also another example I found on the web on msdn
    >
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs0
    > 5/html/GrdDetView.asp (Listing 4. Using Callbacks when Sorting and
    > Paging section)
    >
    > states that...
    >
    > <snipp>
    > Client-Side Sorting and Paging
    > The GridView control provides you with the option of sorting and
    > paging
    > records without requiring a form-post back to the Web server. In other
    > words, you can re-render the contents of a GridView when sorting and
    > paging, without needing to re-render the entire page.
    > You enable client paging and sorting by assigning the value true to
    > the
    > EnableSortingAndPagingCallback property. When this property has the
    > value true, the GridView uses JavaScript to request an updated set of
    > records from the Web server.
    > <snipp>
    > I tried the piece of code that was provided...
    >
    > <html>
    > <head runat="server">
    > <title>Callback GridView</title>
    > </head>
    > <body>
    > <form runat="server">
    > <%=DateTime.Now %>
    >
    > <asp:GridView
    > DataSourceID="TitlesSource"
    > EnableSortingAndPagingCallbacks="true"
    > AllowPaging="true"
    > AllowSorting="true"
    > Runat="Server" />
    > <asp:SqlDataSource
    > ID="TitlesSource"
    > ConnectionString=
    > "Server=localhost;Database=pubs;Trusted_Connection=true"
    > SelectCommand="SELECT * FROM Titles"
    > Runat="Server" />
    > </form>
    > </body>
    > </html>
    >
    > but even though sorting and paging callbacks are ENABLED, the TIME
    > which is NOT supposed to be updated, still gets updated everytime I do
    > a sort or change the page.
    >
    > Does anyone have any idea why this is happening? Am I misunderstanding
    > the whole concept of callbacks? I made sure I am using the 2.0
    > framework and using ASP.NET 2.0, just because I installed Visual
    > Studio 2005 on top of my existing Visual Studio 2003.
    >
    > This sucks...I hope someone can shed some light for me into this.
    >
    > Thanks for your time and help in advance.
    >
    > Best Regards,
    >
    > Tim :)
    >
     
    Brock Allen, Jun 6, 2005
    #2
    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. ck388
    Replies:
    1
    Views:
    10,752
    Brock Allen
    Jun 6, 2005
  2. yefei

    sorting and paging in gridview

    yefei, Mar 29, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,189
    yefei
    Mar 30, 2006
  3. yefei
    Replies:
    5
    Views:
    13,813
    Aytaç ÖZAY
    Apr 14, 2006
  4. =?Utf-8?B?TWl0Y2g=?=

    GridView Sorting and paging Not working

    =?Utf-8?B?TWl0Y2g=?=, Jun 12, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,189
    =?Utf-8?B?TWl0Y2g=?=
    Jun 12, 2006
  5. anil reddy
    Replies:
    0
    Views:
    959
    anil reddy
    Feb 11, 2009
Loading...

Share This Page