2011-10-28 7 views
1

私はListViewを持っており、DataPager.iでページングしています。ストアドプロシージャを使用してページングされたDataを返します。ストアドプロシージャは、 。ストアドプロシージャを使用してpagenoとmaxrowを動的に設定する

私のストアドプロシージャは、私のリスト表示レイアウトで

crate procedure [dbo].[Sp_ProductList] 
@Id int, 
@Country int, 
@state int, 
@City int, 
@Group int, 
@pageno int, 
@pageCount int out 
as begin 
--custom search 
end 

では私の問題は、私は、ストアドプロシージャからのページングデータにdatapager.basedにページングを設定することができる方法である

<asp:ListView ID="LstCatalogue" runat="server" OnSelectedIndexChanged="LstCatalogue_SelectedIndexChanged"> 
    <LayoutTemplate> 
<div id="productContent" class="center_Productcontent"> 
       <div runat="server" id="ItemPlaceholder"></li> 
      </div> 
    <div class="Pager"> 
     <asp:DataPager ID="pgrUpper" runat="server" PageSize="9" PagedControlID="LstCatalogue"> 
      <Fields> 
      <asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="First" PreviousPageText="Previous" RenderDisabledButtonsAsLabels="true" RenderNonBreakingSpacesBetweenControls="true" ShowFirstPageButton="true" ShowNextPageButton="false" ShowLastPageButton="false" ShowPreviousPageButton="true" /> 
      <asp:NumericPagerField ButtonCount="10" NumericButtonCssClass="command" CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="command" RenderNonBreakingSpacesBetweenControls="true" /> 
      <asp:NextPreviousPagerField ButtonCssClass="command" NextPageText="Next" LastPageText="Last" RenderDisabledButtonsAsLabels="true" ShowFirstPageButton="false" ShowPreviousPageButton="false" ShowNextPageButton="true" ShowLastPageButton="true" /> 
     </Fields> 
     </asp:DataPager> 
      </div> 


     </LayoutTemplate> 
    </asp:ListView> 

です。あなたはこのように行うことができます

答えて

0

..... datapagerコントロールに.....

<asp:DataPager ID="dataPagerNumeric" 
       runat="server" PageSize="5"> 
        <Fields> 
         <asp:NumericPagerField ButtonCount="5" 
         NumericButtonCssClass="numeric_button" 
         CurrentPageLabelCssClass="current_page" 
             NextPreviousButtonCssClass="next_button" /> 
        </Fields> 
       </asp:DataPager> 
       <td colspan="4" class="number_of_record"> 
        <asp:DataPager ID="dataPageDisplayNumberOfPages" 
        runat="server" PageSize="5"> 
        <Fields> 
          <asp:TemplatePagerField> 
           <PagerTemplate> 
            <span style="color: Black;">Records: 
              <%# Container.StartRowIndex >= 0 ? 
              (Container.StartRowIndex + 1) : 0 %> - 
              <%# (Container.StartRowIndex + 
        Container.PageSize) 
              > Container.TotalRowCount ? 
        Container.TotalRowCount : 
              (Container.StartRowIndex + 
        Container.PageSize)%> of 
              <%# Container.TotalRowCount %> 
               </span> 
              </PagerTemplate> 
             </asp:TemplatePagerField> 
            </Fields> 
           </asp:DataPager> 
          </td> 
         </td> 
        </tr> 
       </table> 
      </LayoutTemplate> 

あなたはplsは、このリンクを介してFor more Info

を行くだろう、私はそれはあなたを助け願っています...

関連する問題