Re: Disappearing GridView - Newsgroup???

Tech-Archive recommends: Fix windows errors by optimizing your registry




Don Miller wrote:
So, how can you use GridView with callback paging without postbacks? What's
missing from the code and why shouldn't the code work? And where is the
documentation for avoiding this problem?

Hi,
The GridView disappers because it is empty. If you want to use a
callback to change the page set GridView's datasource in the page load
event handler. You don't need to process PageIndexChanging event, it
is not raised.

<asp:GridView ID="AuthorsGridView" runat="server" AllowPaging="True"
EnableSortingAndPagingCallbacks="True" PageSize="3">
......
</asp:GridView>

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
bindDataToGridView()
End If

If Not IsCallback Then
......
AuthorsGridView.DataSource = ds
'AuthorsGridView.DataBind() Don't bind here!
End If
End Sub

Regards

.



Relevant Pages

  • Re: Help with simplifying my Code
    ... Hi, does this code work? ... Instead use MePRICE1 Is Null or IsNull ... Sub PRICE() ... For intCount = vintIndex To 10 ...
    (microsoft.public.access.formscoding)
  • Re: Help with simplifying my Code
    ... > Hi, does this code work? ... > Sub PRICE() ... > Dim intCount As Integer ... Thanks Graeme ...
    (microsoft.public.access.formscoding)
  • WHY, WHY WONT IT WORK???
    ... For some reason I just can't get this piece of code work! ... Public Class Webdefault ... #Region " Web Form Designer Generated Code " ... End Sub ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: find2perl
    ... These three lines of code work, ... sub date_me { ... undef, undef, undef) = localtime; ...
    (perl.beginners)