Infragistics35.WebUI.UltraWebGrid.v10.1
Pattern Property
See Also  Example
Infragistics.WebUI.UltraWebGrid Namespace > Pager Class : Pattern Property

Pattern text template displayed within the page selection pane.

Syntax

Visual Basic (Declaration) 
Public Overridable Property Pattern As String
C# 
public virtual string Pattern {get; set;}

Example

This example shows a number of different pattern strings that can be applied to the grid to customize the pager links.

Visual BasicCopy Code
Protected Sub UltraWebGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles UltraWebGrid1.InitializeLayout
    ' You can change the pattern with any StyleMode type
    e.Layout.Pager.AllowPaging = True
    e.Layout.Pager.StyleMode = PagerStyleMode.Numeric

    'Create previous and next links for a numeric pager
    e.Layout.Pager.Pattern = "[prev] [default] [next]"

    ' Add information about current page and number of pages
    ' e.Layout.Pager.Pattern = "Page [currentpageindex] of [pagecount]. [default]"

    ' Create links to first, next, previous and last pages.
    ' e.Layout.Pager.Pattern = "[page:first:First] [page:prev:Previous] [page:next:Next] [page:last:Last]"

    ' Change the text for specific pages
    ' e.Layout.Pager.Pattern = "[page:1:First page] [page:2:Second page] [page:3:Third page]"

    ' Add extra HTML into the pager area
    ' e.Layout.Pager.Pattern = "[default] <br> Total pages <strong>[pagecount]</strong>"
End Sub
C#Copy Code
protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
   
// You can change the pattern with any StyleMode type
   
e.Layout.Pager.AllowPaging = true;
   e.Layout.Pager.StyleMode = PagerStyleMode.Numeric;

   
// Create previous and next links for a numeric pager
   
e.Layout.Pager.Pattern = "[prev] [default] [next]";

   
// Add information about current page and number of pages
   
// e.Layout.Pager.Pattern = "Page [currentpageindex] of [pagecount]. [default]";

   
// Create links to first, next, previous and last pages.
   
// e.Layout.Pager.Pattern = "[page:first:First] [page:prev:Previous] [page:next:Next] [page:last:Last]";

   
// Change the text for specific pages
   
// e.Layout.Pager.Pattern = "[page:1:First page] [page:2:Second page] [page:3:Third page]";

   
// Add extra HTML into the pager area
   
// e.Layout.Pager.Pattern = "[default] <br> Total pages <strong>[pagecount]</strong>";
}

Remarks

Use this to customize the text displayed in the pager area by adding literal text, HTML formatting and substitution tokens within square brackets that are replaced at run-time.

  • [default] - default pager HTML markup is rendered here. The actual text will depend on the StyleMode setting.
  • [currentpageindex] - index of the current page.
  • [pagecount] - number of pages.
  • [pagesize] - number of rows per page.
  • [prev] - the link to the previous page.
  • [next] - the link to the next page.
  • [page:N:text] - the link to the page N. N can be either the page number or words 'first', 'prev', 'next' or 'last'. The text value is used for the link name; if omitted the page number is rendered.

Make sure you include the [default] token or the pager links generated by the StyleMode setting won't be rendered. The Pattern property can be used with all StyleMode settings.

See Also

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 1996-2009 Infragistics, Inc. All rights reserved.

Build Version: 10.1