I've subclassed the RadGrid to be able to provide a consistent, customized behavior for it in my web application.
Right now I'm trying to customize the pagesize combobox in the RadGrid, so it will display more options than the default.
The page size combobox correctly displays the new list of options, but selecting one of them does nothing. No event is fired and the grid contents is not updated.
What do I need to do to make it work?
My code:
Right now I'm trying to customize the pagesize combobox in the RadGrid, so it will display more options than the default.
The page size combobox correctly displays the new list of options, but selecting one of them does nothing. No event is fired and the grid contents is not updated.
What do I need to do to make it work?
My code:
Protected
Overrides
Sub
OnItemCreated(e
As
Telerik.Web.UI.GridItemEventArgs)
If
TypeOf
e.Item
Is
GridPagerItem
Then
Dim
l_oPageSize
As
RadComboBox =
DirectCast
(e.Item.FindControl(
"PageSizeComboBox"
), RadComboBox)
l_oPageSize.Items.Clear()
Dim
l_oItem
As
RadComboBoxItem
For
l_iIndex
As
Integer
= 10
To
150
Step
10
l_oItem =
New
RadComboBoxItem(l_iIndex)
l_oPageSize.Items.Add(l_oItem)
Next
l_oItem =
New
RadComboBoxItem(200)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(300)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(300)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(350)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(400)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(450)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(500)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(600)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(700)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(800)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(900)
l_oPageSize.Items.Add(l_oItem)
l_oItem =
New
RadComboBoxItem(1000)
l_oPageSize.Items.Add(l_oItem)
Dim
l_iW
As
Integer
= l_oPageSize.Width.ToString.Substring(0, l_oPageSize.Width.ToString.IndexOf(
"px"
))
l_oPageSize.Width = Unit.Pixel(l_iW + 10)
End
If
MyBase
.OnItemCreated(e)
End
Sub