Hi,
one of my RadGrid's shows a very strange behaviour. I have bound it to a Linq Datasource which returns 14 datasets from the database. The page size of the grid is set to 10 sou it shows 2 pages. Now, the problem is, that some entries which exist in the database are not visible in the grid while others appear twice. When I use the filter function, I can see the missing entries as soon as I remove the filter, they are gone again.
This is very strange. What could be wrong here?
Best Regards,
Robert
6 Answers, 1 is accepted
0
Hi Robert,
Can you post an example where we can reproduce and debug this?
Kind regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Can you post an example where we can reproduce and debug this?
Kind regards,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
0
Robert
Top achievements
Rank 1
answered on 13 Sep 2008, 08:24 AM
I did change my grid's data source from LinqDataSource to SqlDataSource. This seems to be a workaround since the problem does not arise here. Anyway, it would be great to know what's wrong with the usage of a LinqDataSouce.
Have a nice weekend,
Robert
0
Hello Robert,
Because there wasn't any database attached to the project I used Northwind, more precisely the Customers table, to test the project. It seems to be working fine on my end. RadGrid bound with LinqDataSource shows all the records in the Customers table.
I am attaching the project to this forum post. I will appreciate if you outline the differences between my test case and yours - they can help us determine the source of the issue to address it accordingly.
Best regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Because there wasn't any database attached to the project I used Northwind, more precisely the Customers table, to test the project. It seems to be working fine on my end. RadGrid bound with LinqDataSource shows all the records in the Customers table.
I am attaching the project to this forum post. I will appreciate if you outline the differences between my test case and yours - they can help us determine the source of the issue to address it accordingly.
Best regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 15 Sep 2008, 12:03 PM
Hi Nikolay,
thank you for your reply. Indeed, your project works as expected. The missing database the project I provided was my fault. I have created another one which contains a database and illustrates the problem. This project has been tested on
two different machines with the same result. The most obvious difference is, that I don't use Northwind.
These are the steps I executed:
* Create a new Project and add a Database file
* Create a table with one identiy column and one value column (varchar)
* Add some values to the table
* Create a RadGrid and configure paging and enable filtering
* Create a LinqDataSource which selects only the value column of the table
* Run the project
Get the new project here
Best regards,
Robert
0
Hello Robert,
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Unfortunately I was able to replicate the issue and it seems to be a problem in LinqDataSource control. You can try to remove the projection in Select property of LinqDataSource control and RadGrid will work as expected.
You can easily observe the problem if you use MS GridView control.
If you play with LinqDataSource a little bit by setting Select property as “Select="new (Name,Id)"” you will see the same problem in both RadGrid and GridView controls.
Possible solution to work around this discrepancy is to set “Select="new (Id, Name)"” or not use projection at all, i.e leave Select property unset.
Greetings,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.