Hello,
I have a problem with XPO (again :) ). If query that is created has more than one table in join, you switch to server side calculation, instead of SQL, and this breaks the data. I have created a demo, and inside there are examples of queries that don't work.
The problem is manifested if you try to filter grid on something, entering a text into search area. Oids will remain in grid (surprisingly) but the data in second column is lost. Filtering is applied, because if you enter a text which is not there, you will get message that there are is not data to show.
Also if you group by Oid, data from second column is lost.
Why I say again, because it is a question of translating Linq to XPO, and then XPO to SQL, and I already had an issue with similar problem which was solved.
Previous issue:
https://www.devexpress.com/Support/Center/Question/Details/T288428
Thank you in advance
If you only sort on the column, than it is working.
It seems that at certain "complexity" level, you just switch from creating a full SQL (although possible) to getting data and calculating on app server side, and than this results in data not showing…
Seems so…
Hello Muris.
The grid usually shows empty cells if an exception is thrown during data loading or evaluation. You could see the exception if you enable the corresponding option in the debugger (see How to: Break When an Exception is Thrown).
In your scenario, the exception is thrown when the filter is being be applied to the source query, and the conditional operator cannot determine the object type to access the OID property. To avoid this exception, modify the query as follows:
return new XPQuery<AllTable>(session) .Join(new XPQuery<Company>(session), relation => relation.DataOid, comapny => comapny.OID, (relation, ormcompanycustom) => new { Company = ormcompanycustom, Relation = relation }) .Join(new XPQuery<Person>(session), relation => relation.Relation.DataOid, person => person.OID, (relation, person) => new { Person = person, Company = relation.Company, Relation = relation.Relation }) .Select(t => new { OID = t.Relation.DataOid, Title = t.Company != null ? t.Company.Name : t.Person.FirstName, });
This solved the thing. Thank you very much.
Make it as a solution, and I mark it.
For me to understand the problem, I don't understand difference between OID and Title. Is this only for OID since it is used for joining or it is also the case for other data that could come from AllTable.
Thank you once again Michael.
We have researched your scenario and come to the conclusion that it is a bug in our code. We will fix it as soon as we can. In the mean time, please use the solution I provided.
No problem.
Thank you for great support experience.
I guess this fix is coming with next release? I'm not in a rush, just to say.
>>I guess this fix is coming with next release?
This information will be known a bit later. You will be automatically notified of this via email, as always.
OK, great, thank you.