RadGrid for ASP.NET

RadGrid Send comments on this topic.
PagerStyle Property
See Also  Example
Telerik.WebControls Namespace > RadGrid Class : PagerStyle Property


Gets a reference to the GridPagerStyle object that allows you to set the appearance of the page item in a Telerik RadGrid control.   

 

Namespace: Telerik.WebControls
Assembly: RadGrid (in RadGrid.dll)

Syntax

Visual Basic (Declaration) 
Public Overridable ReadOnly Property PagerStyle As GridPagerStyle
Visual Basic (Usage)Copy Code
Dim instance As RadGrid
Dim value As GridPagerStyle
 
value = instance.PagerStyle
C# 
public virtual GridPagerStyle PagerStyle {get;}

Return Value

A GridPagerStyle object that contains the style properties of the paging section of the RadGrid control. The default value is an empty GridPagerStyle object.

Example

The following code example demonstrates how to use the PagerStyle property to specify a custom style for the page selection elements of the RadGrid control.
Visual BasicCopy Code
<%@ Page Language="VB" %>

<%@ Import Namespace="System.Data" <see cref="> <"/>@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadGrid.Net2" %>
<!DOCTYPE html Public "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script runat="server">

    Function CreateDataSource() As ICollection
        Dim dt As New DataTable()
        Dim dr As DataRow

        dt.Columns.Add(New DataColumn("IntegerValue", GetType(Int32)))
        dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
        dt.Columns.Add(New DataColumn("DateTimeValue", GetType(String)))
        dt.Columns.Add(New DataColumn("BoolValue", GetType(Boolean)))

        Dim i As Integer
        For i = 0 To 99
            dr = dt.NewRow()

            dr(0) = i
            dr(1) = "Item " & i.ToString()
            dr(2) = DateTime.Now.ToShortDateString()
            If i Mod 2 <> 0 Then
                dr(3) = True
            Else
                dr(3) = False
            End If

            dt.Rows.Add(dr)
        Next i

        Dim dv As New DataView(dt)
        Return dv
    End Function 'CreateDataSource

    Sub ShowStats()
        lblEnabled.Text = "AllowPaging is " & RadGrid1.AllowPaging
        lblCurrentIndex.Text = "CurrentPageIndex is " & RadGrid1.CurrentPageIndex
        lblPageCount.Text = "PageCount is " & RadGrid1.PageCount
        lblPageSize.Text = "PageSize is " & RadGrid1.PageSize
    End Sub 'ShowStats


    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        RadGrid1.DataSource = CreateDataSource()
        ShowStats()
    End Sub

    Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            RadGrid1.PagerStyle.Mode = GridPagerMode.