示例#1
0
 private void AppendNumericButtons(IGridUrlBuilder urlBuilder, int currentPage, int numericStart, IHtmlNode numericDiv, int numericEnd)
 {
     for (var page = numericStart; page <= numericEnd; page++)
     {
         buttonFactory.CreateButton(GridPagerButtonType.NumericLink, page != currentPage,
                                    GetUrl(urlBuilder, page), page.ToString(), page).AppendTo(numericDiv);
     }
 }
        private void AppendNextLast(IHtmlNode container, GridPagerStyles style,
                                    IGridUrlBuilder urlBuilder, int currentPage, int pageCount)
        {
            if ((style & GridPagerStyles.NextPrevious) != GridPagerStyles.NextPrevious)
            {
                return;
            }

            buttonFactory.CreateButton(GridPagerButtonType.Icon, "next", currentPage < pageCount,
                                       GetUrl(urlBuilder, currentPage + 1)).AppendTo(container);

            buttonFactory.CreateButton(GridPagerButtonType.Icon, "last", currentPage < pageCount,
                                       GetUrl(urlBuilder, pageCount)).AppendTo(container);
        }
        private void AppendNextLast(IHtmlNode container,
                                    IGridUrlBuilder urlBuilder, GridPagerData section)
        {
            if (section.PreviousNext)
            {
                buttonFactory.CreateButton(GridPagerButtonType.Icon, section.Page < section.TotalPages,
                                           GetUrl(urlBuilder, section.Page + 1),
                                           "arrow-e", section.Page + 1, section.IsInClientTemplate)
                .Attribute("title", section.Messages.Next)
                .AppendTo(container);

                buttonFactory.CreateButton(GridPagerButtonType.Icon, section.Page < section.TotalPages,
                                           GetUrl(urlBuilder, section.TotalPages), "seek-e", section.TotalPages, section.IsInClientTemplate)
                .Attribute("title", section.Messages.Last)
                .AppendTo(container);
            }
        }