Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview, using Callbacks when Sorting and Paging

Reply
Thread Tools

Gridview, using Callbacks when Sorting and Paging

 
 
ck388
Guest
Posts: n/a
 
      06-06-2005
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/as.../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/de...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

 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-06-2005
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/as...a/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/de...ry/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
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling browser back button for GridView Paging and Sorting in Ajax1.1 and 3.5 (using Visual Studio 2005/ Visual studio 2008) anil reddy ASP .Net 0 02-11-2009 04:22 PM
Custom paging/sorting using Gridviews Roy ASP .Net 0 05-23-2006 07:52 PM
Gridview, using Callbacks when Sorting and Paging ck388 ASP .Net Web Controls 1 06-06-2005 09:55 PM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
Datagrid custom sorting and paging using stored procedure Mo ASP .Net 1 01-30-2004 07:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57