Hi,
I am using RadControls for ASP.NET Ajax 2011 Q2.
I've got a RadGrid with paging enabled, and the page sizes can be changed. To achieve custom page sizes, I got this:
In the same aspx I have an overlay div which grays out the page and displays a waiting icon. It can be called via javascript, the code executing the overlay is simple and always works fine, because the elements both exist in every page:
I use the RadComboBox'es OnClientSelectedIndexChanged Attribute on many ComboBoxes, that are Autopostback and do something time consuming, for this I have the function:
The trouble comes, when I set the
The PageSizeCombo actually does display the overlay div as it should, BUT there is no PostBack.
Several other RadComboBoxes on the same page are AutoPostBack==true also, and they all still fire the PostBack even with th
When I manually enable the AutoPostBack of the RadComboBox, there is a PostBack, but the RadGrid's NeedDataSource event isn't called (in which I use the new page size, if there is any).
When I manually add a SelectedIndexChanged, that should refresh the data source (used by other RadComboBoxes!), the event still doesn't fire:
I really don't know what else to try, and I am wondering if this might be a bug, or at least something that doesn't work because nobody expected anyone to use the OnClientSelectedIndexChanged attribute of this builtin RadComboBox?
I would appriciate any fixed or workarounds, apart from creating my own RadComboBox for the pagesizes, because I don't want to fiddle with getting my own RadComboBox right next to the other paging controls.
Cheers
I am using RadControls for ASP.NET Ajax 2011 Q2.
I've got a RadGrid with paging enabled, and the page sizes can be changed. To achieve custom page sizes, I got this:
void RadGridView1_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("25")); PageSizeCombo.FindItemByText("25").Attributes.Add("ownerTableViewId", RadGridView1.MasterTableView.ClientID); // and so on...In the same aspx I have an overlay div which grays out the page and displays a waiting icon. It can be called via javascript, the code executing the overlay is simple and always works fine, because the elements both exist in every page:
function showLoadingOverlay() { try { $("#overlaydiv").css('visibility', 'visible'); $(".loadingImage").css('visibility', 'visible'); } catch (exc) { }}function hideLoadingOverlay() { try { $("#overlaydiv").css('visibility', 'hidden'); $(".loadingImage").css('visibility', 'hidden'); } catch (exc) { }}I use the RadComboBox'es OnClientSelectedIndexChanged Attribute on many ComboBoxes, that are Autopostback and do something time consuming, for this I have the function:
function OnClientSelectedIndexChanged(item) { showLoadingOverlay();}The trouble comes, when I set the
OnClientSelectedIndexChanged method of the RadComboBox used for chaning page size, like this:void RadGridView1_ItemDataBound(object sender, GridItemEventArgs e){ if (e.Item is GridPagerItem) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.OnClientSelectedIndexChanged = "OnClientSelectedIndexChanged"; // ...The PageSizeCombo actually does display the overlay div as it should, BUT there is no PostBack.
Several other RadComboBoxes on the same page are AutoPostBack==true also, and they all still fire the PostBack even with th
eOnClientSelectedIndexChanged event.When I manually enable the AutoPostBack of the RadComboBox, there is a PostBack, but the RadGrid's NeedDataSource event isn't called (in which I use the new page size, if there is any).
void RadGridView1_ItemDataBound(object sender, GridItemEventArgs e){ if (e.Item is GridPagerItem) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.OnClientSelectedIndexChanged = "OnClientSelectedIndexChanged"; PageSizeCombo.AutoPostBack = true;When I manually add a SelectedIndexChanged, that should refresh the data source (used by other RadComboBoxes!), the event still doesn't fire:
void RadGridView1_ItemDataBound(object sender, GridItemEventArgs e){ if (e.Item is GridPagerItem) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.OnClientSelectedIndexChanged = "OnClientSelectedIndexChanged"; PageSizeCombo.AutoPostBack = true; PageSizeCombo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(FilterChanged_RadComboBox);I really don't know what else to try, and I am wondering if this might be a bug, or at least something that doesn't work because nobody expected anyone to use the OnClientSelectedIndexChanged attribute of this builtin RadComboBox?
I would appriciate any fixed or workarounds, apart from creating my own RadComboBox for the pagesizes, because I don't want to fiddle with getting my own RadComboBox right next to the other paging controls.
Cheers