Imports Telerik.Web.UI

Partial Class _Default
    Inherits System.Web.UI.Page


    Private TotalItemCount As Integer
    Protected Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)

        If TypeOf e.Item Is GridPagerItem Then
            Dim allItemsCount As Integer = TryCast(e.Item, GridPagerItem).Paging.DataSourceCount
            Dim combo As RadComboBox = TryCast(TryCast(e.Item, GridPagerItem).FindControl("PageSizeComboBox"), RadComboBox)
            Dim item As New RadComboBoxItem("All", allItemsCount.ToString())
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID)
            combo.Items.Add(item)
            combo.Items.FindItemByValue(RadGrid1.PageSize.ToString()).Selected = True
        End If
    End Sub
End Class
