I am using vs 2005. I add some rows asynchroniously(using Ajax) into
Rad Grid, with filtering enable. But it failed.
To fix this bug, I remove some Ajax capabilities, enabling a full page
postback when adding rows into Rad Grid. Then, Rad Grid's filtering
works.
Does Rad Grid filtering need a full page postback before filters work?
Thanks.
Stanley
7 Answers, 1 is accepted
RadGrid does not require full postback for its filtering to work. You can verify this in the following online demo:
Basic grid filtering
The problem most probably lies in RadGrid's definition and initialization. Could you, please, provide some code samples for us to look at?
Regards,
Veli
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
as you request, here is my code for RadGrid. I am using VS 2005.
<rad:RadAjaxPanel ID="rapGrid" runat="server" Height="20px" Width="850px" LoadingPanelID="alpLoading" >
<rad:RadGrid ID="rgJobInv" runat="server" AllowFilteringByColumn="false" AllowPaging="True" AllowSorting="True"
GridLines="None" AutoGenerateColumns="false" Width="100%" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"
AllowMultiRowSelection="true" AllowMultiRowEdit="true" OnItemCommand="rgJobInv_ItemCommand"
SelectedItemStyle-BackColor="navy" SelectedItemStyle-ForeColor="white">
<ClientSettings AllowDragToGroup="false">
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView AutoGenerateColumns="false" DataKeyNames="JobsID" EditMode="InPlace" AllowAutomaticDeletes="true"
AllowAutomaticUpdates="true" Width="100%" PageSize="30" PagerStyle-Mode="NextPrevAndNumeric" AllowSorting="true"
AlternatingItemStyle-BackColor="#ffffd9" CommandItemDisplay="Bottom">
Please help.
Thank you.
Stanley Huang
I would like to add: I allow my Web app users to toggle RadGrid filtering:
protected void btnToggleFilters_Click(object sender, EventArgs e)
{
if (rgJobInv.AllowFilteringByColumn == true)
{
rgJobInv.AllowFilteringByColumn = false;
rgJobInv.MasterTableView.AllowFilteringByColumn = false;
}
else
{
rgJobInv.AllowFilteringByColumn = true;
...
}
I think, users toggle the filtering on and off, that makes the RadGrid to require
a full page postback, for filtering to work.
Thank you for your help.
Stanley Huang
As illustrates in the online demo linked by my colleague Veli, you can toggle the visibility of the grid filter item using the showFilterItem()/hideFilterItem() methods from the client-side API (see the radio buttons at the top of the page). Hence you do not need to perform postback or ajax request in order to perform the requested action.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The code that Stanley provided did work up until the most recent release. I am using something exactly like it in my some of my projects. Since upgrading to 2008.2 826, the filtering on all my grids using the previous code is broken. I get errors in the MicrosoftAjax.js about a missing object.
Chris
Do you use RadScriptManager on the page with the grid? If so, can the reason for it be the one discussed in this public forum thread? I suggest you test the custom build attached to the forum post and let us know whether it helps.
Best regards,
Stephen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
That is the problem I am experiencing. I requested and received a dev build that fixes the problem. Thanks.
Chris