Jump to content
Fórum Script Brasil
  • 0

Paginação de listview


MrJunior

Question

Pessoal, tem uma aplicação aqui no trabalho, onde uma determinada tela está com um listview, e a depender da consulta a tela acaba ficando pesada. Decidir então fazer uma paginação desse list, porém, ele não pagina. Estou utilizando o obejto DataPage, porém, nada acontece. Creio que não devo está configurando o mesmo corretamente. Abaixo segue meu codigo.

<asp:ListView ID="list" runat="server" DataMember="DefaultView" 
                        Visible="True" OnItemDataBound="list_ItemDataBound" 
                        onpagepropertieschanging="listPrestador_PagePropertiesChanging">
                        <ItemTemplate>
                            <div id="rede_refereniado">
                                <h4>
                                    <%# Eval("Nome")%></h4>
                                <asp:Label ID="lblTelefone" runat="server" Text="Telefones: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtTelefones" runat="server" Text='<%#String.Concat(Eval("Enderecos.Ddd_telefone"), Eval("Enderecos.Num_telefone"))%>'
                                    Width="200px" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblEnderecos" runat="server" Text="Cep: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtenderecos" runat="server" Text='<%#Eval("Enderecos.Cep")%>' Width="100px"
                                    TextMode="MultiLine"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lbllogradouro" runat="server" Text="Endereço: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtlogradouro" runat="server" Text='<%#String.Concat(Eval("Enderecos.Logradouro"), Eval("Enderecos.Numlogradouro"))%>'
                                    Width="420px" TextMode="MultiLine" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblComplemento" runat="server" Text="Complemento: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtComplemento" runat="server" Text='<%#String.Concat(Eval("Enderecos.Complemento"), "")%>'
                                    Width="420px" TextMode="MultiLine" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblBairro" runat="server" Text="Bairro: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtBairro" runat="server" Text='<%#String.Concat(Eval("Enderecos.Bairro"), "")%>'
                                    Width="420px" TextMode="MultiLine" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblEndMunicipio" runat="server" Text="Municipio: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtEndMunicipio" runat="server" Text='<%#String.Concat(Eval("Enderecos.Municipio"), " - ", Eval("Enderecos.Uf"))%>'
                                    Width="420px" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblHorario" runat="server" Text="Horario: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtHorario" runat="server" Text='<%#Eval("Horario")%>' Width="420px"
                                    TextMode="MultiLine" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:Label ID="lblEspecialidade" runat="server" Text="Especialidade: " Width="100px"></asp:Label>
                                <asp:TextBox ID="txtEspecialidade" runat="server" Text='<%#Eval("EspecialidadePrestador")%>'
                                    Width="420px" TextMode="MultiLine" Height="30px" ReadOnly="true"></asp:TextBox>
                                <br class="br" />
                                <asp:LinkButton ID="LinkButton1" runat="server">Ver Mapa</asp:LinkButton></p>
                            </div>
                          

                        </ItemTemplate>
                        <EmptyDataTemplate>
                            <br />
                            <br />
                        </EmptyDataTemplate>
                        <LayoutTemplate>
                            <div id="itemPlaceholderContainer" runat="server" style="">
                                <span id="itemPlaceholder" runat="server" />
                            </div>
                        </LayoutTemplate>
                    </asp:ListView>
                      <asp:DataPager ID="dtpList" runat="server" PagedControlID="list" PageSize="5" >
                        <Fields>
                            <asp:NumericPagerField />
                        </Fields>
                        
                                            </asp:DataPager>

O binding efetuo no code behind mesmo.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...