Hi,
I had this code to add some custom page size on RadGrid:
protected void RadGridInvoiceList_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridPagerItem)
{
RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
PageSizeCombo.Items.Clear();
PageSizeCombo.Items.Add(new RadComboBoxItem("10", "10"));
PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20"));
PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50"));
PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100"));
PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200"));
PageSizeCombo.Items.Add(new RadComboBoxItem("300", "300"));
PageSizeCombo.Items.Add(new RadComboBoxItem("400", "400"));
PageSizeCombo.Items.Add(new RadComboBoxItem("500", "500"));
PageSizeCombo.Items.Add(new RadComboBoxItem("1000", "1000"));
PageSizeCombo.Items.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
PageSizeCombo.DropDownWidth = Unit.Pixel(60);
PageSizeCombo.AutoPostBack = true;
}
}
.....
protected void RadGridInvoiceList_Load(object sender, EventArgs e)
{
GridItem[] pagers = this.RadGridInvoiceList.MasterTableView.GetItems(GridItemType.Pager);
foreach (GridItem pager in pagers)
{
RadComboBox comboBox = (RadComboBox)pager.FindControl("PageSizeComboBox");
comboBox.SelectedIndexChanged += delegate(object _source, RadComboBoxSelectedIndexChangedEventArgs _e)
{
RadGridInvoiceList.MasterTableView.PageSize = Convert.ToInt32(_e.Value);
RadGridInvoiceList.Rebind();
};
}
}
For some reason after upgrading to 2010. Q1 stop working. I've also try the latest Build Release but the behaviour is the same. Dows the ajax refresh but the pagesize remains the same.
Thanks
Eduardo Barbosa
I had this code to add some custom page size on RadGrid:
protected void RadGridInvoiceList_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridPagerItem)
{
RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
PageSizeCombo.Items.Clear();
PageSizeCombo.Items.Add(new RadComboBoxItem("10", "10"));
PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20"));
PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50"));
PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100"));
PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200"));
PageSizeCombo.Items.Add(new RadComboBoxItem("300", "300"));
PageSizeCombo.Items.Add(new RadComboBoxItem("400", "400"));
PageSizeCombo.Items.Add(new RadComboBoxItem("500", "500"));
PageSizeCombo.Items.Add(new RadComboBoxItem("1000", "1000"));
PageSizeCombo.Items.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
PageSizeCombo.DropDownWidth = Unit.Pixel(60);
PageSizeCombo.AutoPostBack = true;
}
}
.....
protected void RadGridInvoiceList_Load(object sender, EventArgs e)
{
GridItem[] pagers = this.RadGridInvoiceList.MasterTableView.GetItems(GridItemType.Pager);
foreach (GridItem pager in pagers)
{
RadComboBox comboBox = (RadComboBox)pager.FindControl("PageSizeComboBox");
comboBox.SelectedIndexChanged += delegate(object _source, RadComboBoxSelectedIndexChangedEventArgs _e)
{
RadGridInvoiceList.MasterTableView.PageSize = Convert.ToInt32(_e.Value);
RadGridInvoiceList.Rebind();
};
}
}
For some reason after upgrading to 2010. Q1 stop working. I've also try the latest Build Release but the behaviour is the same. Dows the ajax refresh but the pagesize remains the same.
Thanks
Eduardo Barbosa