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

Pager not working properly after filtering with UseAllDataFields=true

15 Answers 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RR SoftSol
Top achievements
Rank 1
RR SoftSol asked on 13 Jul 2012, 09:12 AM
Dear Telerik,

At the moment i am experiencing a strange behaviour with the radgrid. The problem is with the pager. It does not update properly when we use a filter on the grid. Say we have a pager with pagesize 20, and 30 items show. It will show 2 pages. After filering though, it will for example only show 5 items in the grid. The pager however still shows 30 items and 2 pages.

This problem only occurs when we use the property UseAllDataFields="true" on our mastertableview.
(i've seen several threads from the past with the same problem, and i've seen that those people also had the same property set).

Note: we do need this property to be set due an excel export. Not sure if we can workaround this by setting it in the code behind only during export.

Information about our grid / scenario:
We have a grid with:
- simple paging (just default paging with total number of items and pages)
- simple filter (just the default telerik textbox in the header, when typed grid gets filtered)
- grid is ajaxified in ajaxmanager
- advanced databinding in the onneeddatasource event. Here we simply set the grid.datasource to a collection of items

We use Telerik version 2012.1.215.35

Thanks in advance!

Ramon

15 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 16 Jul 2012, 06:53 PM
Hello Ramon,

I have created a sample RadGrid web site using the reported RadControls version 2012.1.215 for .NET 3.5. On my side everything works as expected. Could you please check out the attached application and try to distinguish the crucial differences between our projects?

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Luca
Top achievements
Rank 2
answered on 19 Nov 2012, 12:10 PM
Any news about this problem? It's the same exact problem i have, the filter work as expected but it show the result keeping the pagination of the unfiltered Grid, so if you have 8 pages and filter the grid finding a result in the last page, you see 7 pages empty and the last one with one item. This behaviour disappear if you remove UseAllDataFields="true".

I am using Telerik 2012.3.1016.40 and the difference from the project attached there is basically in the bind, i use advanced data-binding but to a list of dynamic taken from database entities not to a sqldatasource. My grid has way more columns but the structure is the same.
0
Eyup
Telerik team
answered on 21 Nov 2012, 09:48 AM
Hi Luca,

I am afraid we are unable to replicate the issue on our end. Please open a support ticket to send us a sample runnable application demonstrating the problematic behavior or provide us the exact steps to reproduce the issue. Thus, we will be able to further analyze the issue and provide a proper solution.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
RR SoftSol
Top achievements
Rank 1
answered on 03 Dec 2012, 08:44 AM
Hi Luca, Telerik,

sadly i didn't have the time to further investigate the issue on our end. Neither did i encounter the same problem again in other projects.
I will post here again once i have more time or encounter the same problem once again.

Greets,

R.
0
Matthew
Top achievements
Rank 1
answered on 08 Apr 2013, 11:03 PM
I'm experiencing similar issues.  With UseAllDataFields=true, the pager bar continues to show the full number of pages even when I've filtered to a subset that should only take up one or two pages.  Also, I've noticed that filtering isn't accurate at all.  Many times it shows no results when there should be.  When I remove the "UseAllDataFields" setting, Both filtering and paging work exactly as they should.  Unfortunately, I'm in the same situation as one of the other posters here.  I need this set for Excel export.

I cannot share code due to company restrictions.  Not even with a NDA.  But I'll answer any questions I can to help resolve this.  I've downloaded the code example that was posted in this thread to see if I could spot any differences.  The first thing I noticed is that the example uses a SqlDataSource.  We're not.  We're basically setting the DataSource property to a generic List in the NeedDataSource handler.

There's a number of other minor differences, but nothing that really relates to the issue.  We are using a RadAjaxManager in the page, but I don't know if that would make any difference.  Usually issues with that are in the flavor of things either not working or disappearing, not like the odd results we're getting with Filtering and Paging.

Let me know if you have any questions.  Any help would be appreciated as I'm quite stuck on this one.

Thank you,

-- Matthew
0
Matthew
Top achievements
Rank 1
answered on 09 Apr 2013, 06:59 PM
- deleting my post -  thought I had a solution, but it turned out to be false.  Another developer had concurrently turned the UseAllDataFields to False.  It fixes my filter, sort, and paging issues, but then prevents the export from working.  Would sure like a solution to this...

Thanks,

-- Matthew
0
Eyup
Telerik team
answered on 11 Apr 2013, 12:48 PM
Hi Matthew,

We are not aware of such problem so far. Can you please share which version of RadControls and .NET framework do you use in your project?

If you want to keep the confidentiality of your files, you can open a support ticket, which is not publicly available, and send us a very basic runnable sample web site demonstrating the problematic behavior. Thus, we will we able to further debug the application to determine the exact cause of the problem.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Matthew
Top achievements
Rank 1
answered on 11 Apr 2013, 03:53 PM
It's obvious from this thread that others are experiencing this same issue.  Personally, in my opinion, saying that you're "not aware" of such a problem seems a little off to me.

So far I cannot create an isolated "bare" re-creation of the issue.  If I could I'd be able to isolate it and resolve it myself.  I've been doing this work for almost twenty years.  You can be assured that once I'm stuck, I've tried all of the obvious solutions.  I have two pages that are nearly identical in structure, yet one of them exhibits this behavior and the other one does not.  I've matched all of the settings right down the line.  The only difference at this point is the data that makes up the rows, and of course the column definitions since it's different data.  It's quite maddening to be certain.

One of the things that would help me would be some real information on just what setting "UseAllDataFields" to True really does.  The documentation is almost non-existent.  Based on the excessive differences in behavior that occur when changing this one field from False to True I have to think there's more going on than what little is stated in the documentation.

After more testing I found that if I added EnableLinqExpressions="True" to the RadGrid, that some of the sorting, filtering, and paging issues were resolved, but it only introduced other problems.  One of those being when I filtered on one column, then sorted on another, the sort didn't have any effect on the displayed data and it caused a small "busy" spinner to be displayed in the bottom left corner of the grid and never go away.  Before this, I'd never seen that spinner.  These pages use the RadAjaxManager and a RadAjaxLoadingPanel.  With the way this is set up, all of the Grid operations result in the LoadingPanel being displayed over the Grid.  At least it did until I set the EnableLinqExpressions property to True.

Again, the documentation on this property is almost non-existent.  Some information on what this really does would be helpful.  What is it's interaction with the UseAllDataFields property?

I find the RadGrid to be extremely brittle.  Each of these changes seem to have dramatic and almost random effects on how the Grid operates, yet there is literally nothing in the documentation that say why.

Is there any way to turn on any kind of advanced debugging?  Even with both client side (FireBug) and server side (Visual Studio) debugging enabled, I cannot see anything out of the ordinary, even when the grid is stuck in the "busy" state as described above.

So far my previous attempts at tickets have all been quite futile, but if I cannot get any more answers here, I'll try that route again.


Thanks.

-- Matthew
0
Eyup
Telerik team
answered on 16 Apr 2013, 12:23 PM
Hello Matthew,

I absolutely understand your frustration on that matter and forwarded this issue to our developers for further insight, however, they confirmed that we have never observed such a problem on our end. The original author of this thread did not provide enough information to enable us to reproduce the issue.

Can you share which version of .NET framework your project is built against? Enabling linq expressions with .NET 3.5 may lead to some issues, as stated in this topic:
http://www.telerik.com/help/aspnet-ajax/grid-basic-filtering.html

Please try to update your RadControls used in the application to the latest release version and see whether the issue still persists.

If the problem remains, we will need the exact steps to replicate the erratic behavior, so we can deeply analyze the issue and provide a more-to-point solution.

Thank you for your understanding. Looking forward to your reply in order to resolve this irritating problem as soon as possible.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Joost
Top achievements
Rank 1
answered on 17 Oct 2013, 09:01 AM
I'm having almost the same issue. The difference for me is that i don't use the "UseAlldataFields" property.
And the pager shows the result correctly the second time I filter.

Example:

I have a grid with 30 items, with 20 items on a page so it shows 30 items on 2 pages.
When I filter it returns 5 items but the pager still displays 30 items on 2 pages.
When i do the filter again the pager is displayed correctly and shows 5 items on 1 page.
When i remove the filter and confirm it the pager shows 30 items on 2 pages, but when i filter for the same value as before it shows 5 items but the pager displays again 30 items on 2 pages.

This only occurs when I use advanced data binding, when I set the data source in the OnNeedDataSource event.
When I'm not using the OnNeedDataSource event and just use the grid property DatasourceID, it works like it should.

I've been searching for a solution for quite some time and i really need an answer.
Thanks in advance!

0
Princy
Top achievements
Rank 1
answered on 17 Oct 2013, 09:36 AM
Hi Joost,

Please try this sample code snippet and see if the issue exist.If it doesn't help,please provide your code snippet and the version you are using.

ASPX:
<telerik:RadGrid ID="myRadGrid" runat="server" AutoGenerateColumns="false" AllowPaging="true"
    PageSize="20" AllowFilteringByColumn="true" OnNeedDataSource="myRadGrid_NeedDataSource">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ShipCity" HeaderText="ShipCity" UniqueName="ShipCity" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

C#:
protected void myRadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
   {    
       String ConnString = ConfigurationManager.ConnectionStrings["Northwind_newConnectionString3"].ConnectionString;
       SqlConnection conn = new SqlConnection(ConnString);
       SqlDataAdapter adapter = new SqlDataAdapter();
       adapter.SelectCommand = new SqlCommand("SELECT OrderID, ShipCity FROM Orders", conn);
       DataTable myDataTable = new DataTable();
       conn.Open();
       try
       {
           adapter.Fill(myDataTable);
       }
       finally
       {
           conn.Close();
       }
       myRadGrid.DataSource = myDataTable;
   }

Thanks,
Princy
0
Joost
Top achievements
Rank 1
answered on 17 Oct 2013, 09:45 AM
I just found a solution to my problem!
In the grid where I used Advanced Data Binding I did this in the OnNeedDataSource event: RadGrid.DataSource = datasrouce;
i changed it to: Radgrid.DataSoruceID = datasource.ID;

Now it works perfectly but i still don't understand why it won't work with RadGrid.DataSource.




0
Joost
Top achievements
Rank 1
answered on 17 Oct 2013, 10:08 AM
Hi,

Now i have the problem that the OnNeedDataSource event doesn't fire anymore after Insert/Update/Delete when using the DataSourceID.
Is there a way to work around it ?

Kind regards.
0
Joost
Top achievements
Rank 1
answered on 17 Oct 2013, 10:39 AM
Hi

I fixed the problem I had by dropping the onneeddatasource event and just filtering my grid in the page load. 
And call a refetch on the datasource after each insert/update/delete

Kind regads.
0
Eyup
Telerik team
answered on 22 Oct 2013, 05:35 AM
Hi Joost,

Generally, NeedDataSource event should handle all of the operations which require grid rebind. If this is not the case with your project, please provide us the exact steps to reproduce the issue or open a support ticket to send us a sample runnable application demonstrating the erratic behavior. Thus, we will be able to further analyze the problem and provide a proper solution.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
RR SoftSol
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Luca
Top achievements
Rank 2
RR SoftSol
Top achievements
Rank 1
Matthew
Top achievements
Rank 1
Joost
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or