Hello,
i got an application where the RadEntityFrameworkDataSource returns no rows.
I have written an Test application, which just handles the issue: the problem remains.
You can download the application at http://w2ww.de/downloads/RadEntityFrameworkDataSource_Test1.zip
You must edit the connection string in the app.config.
I used the .Net Framework in the version 4.5 and Telerik Devcraft for WPF in the version 2015.1.0401.45.
The source:
namespace RadEntityFrameworkDataSource_Test1 {
class Program {
[STAThread]
static void Main(string[] args) {
REFDS_T1Context cntxt = new REFDS_T1Context();
cntxt.Database.CreateIfNotExists();
if (cntxt.Libraries.FirstOrDefault<Library>() == null) {
Library l = new Library("Lib1");
cntxt.Libraries.Add(l);
l = new Library("Lib2");
cntxt.Libraries.Add(l);
cntxt.SaveChanges();
}
var q = (from m in cntxt.Libraries select m).ToList();
Console.WriteLine("---- Output from Linq Queryable");
foreach (Library m in q) {
Console.WriteLine(m.Name);
}
RadEntityFrameworkDataSource refds = new RadEntityFrameworkDataSource();
refds.DbContext = cntxt;
refds.QueryName = "Libraries";
var l2 = refds.DataView;
Console.WriteLine("Output from RadEntityFrameworkDataSource");
var v = l2.TotalItemCount;
Console.WriteLine("TotalItemCount: " + v);
foreach (Library m in l2) { //.ToEnumerable<MediaItem>()
Console.WriteLine(m.Name);
}
Console.WriteLine("---- Ende for Output of: RadEntityFrameworkDataSource");
Console.ReadLine();
}
}
}
----------- The output:
---- Output from Linq Queryable
Lib2
Lib1
Output from RadEntityFrameworkDataSource
TotalItemCount: 0
---- Ende for Output of: RadEntityFrameworkDataSource
---
Best Regards
Winfried Wille