This is a migrated thread and some comments may be shown as answers.

Simultaneous initial filtering on two grids in the same page

2 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sparky
Top achievements
Rank 1
Sparky asked on 06 Sep 2010, 10:40 PM
Good Day

We have two RadGrids in a RadTab/RadMultiPage control. In addition, there is a a RadAjaxManager on the page which is used in code behind to apply some settings to the grids.

The grids are in two separate user controls and the initial filtering only works for one grid - but it seems order matters here. For example, if I put the Issues grid, then the Risk grid on the Mulitpage and run the app, the Risk (the 2nd control added to the page) is initially filtered where as the Issues is left in its default state. In addition, if you try to manually filter the Issues (using a templated column + combobox), it throws an exception about the string not being trimmed. If you ignore this error the Issues grid filter.

Now if you put the Risks grid first then the Issues, the reverse happens, in the the Issues is filtered and the Risks are not. At first I thought that it had something to do with the Mulitpage control but after putting issues and risks in just plain divs, the same thing happened. All I can think of is that there is some ajax call that is overriding filtering on the first grid.

Since I can't attach zipped files here, I have included a solution to highlight the issue I am facing (~16megs) (http://www.mediafire.com/file/f0kdrt8qxubwb20/RadGridTest01.zip     using VS2008 and .NET 3.5 SP1 with ASP.Ajax v.2009.1.527.20 ) . I have two classes called Issues and Risks used to generate data similar to what we currently have in our project. Also I used the OnMasterTableCreated client event of each grid to call the javascript that is supposed to do the filtering.
The actual filtering works in each case individually, but not together.

I hope you can help me figure out what is going on here. Thanks.

2 Answers, 1 is accepted

Sort by
0
Sparky
Top achievements
Rank 1
answered on 07 Sep 2010, 01:09 PM
Here are some images outlining the results

0
Daniel
Telerik team
answered on 10 Sep 2010, 10:13 AM
Hello Sparky,

If you temporary disable AJAX (see below) you will notice that your page is stuck in an endless loop doing one postback after another. This is due to the fact that your client-side isPostback condition is not correct.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="false" />

Let's take this code fragment as an example:
<script language="javascript" type="text/javascript">
    var openRiskSummaryCount = 1;
    function LoadOpenRiskItemsFirstSummary(senderR, args) {
        if (openRiskSummaryCount < 2) {
            var isPostBackr = "<% Response.Write(Page.IsPostBack);%>";
            if (!isPostBackr == false) {
                senderR.get_masterTableView().filter("RiskState", 'Open', Telerik.Web.UI.GridFilterFunction.EqualTo, true);                   
                openRiskSummaryCount++;
            }
        }
    }
</script>

As expected, after the initial load, the isPostBackr variable will be set to false. Now your condition looks like this:  IF (NOT FALSE == FALSE) which will return false and this code will not execute initially. And vice versa, on each subsequent request you will perform a postback.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Sparky
Top achievements
Rank 1
Answers by
Sparky
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or