I'm having a fair bit of trouble trying to get a binding to work between a Data Access Fluent mapped class using the FetchPlans approach.
I had a previously working RadDataGrid working based on an ObservableCollection, which I manually populated, as you would expect. Now I'm converting the app over to Data Access and I'm stumbling. I have the following code that creates the Fetch Strategy and if I look at the log it does generate the output I would expect from the foreach loops.
Previously I had a datasource binding set to {Binding simData.sessionsList} and an itemssource to {Binding}, which worked fine. When I tried accessing the data directly with this: "simData.fluentModelContext.fluentSessions.ToList();" and bound the datasource to {Binding simData.fluentModelContext} and the itemssource to {Binding fluentSessions} that also worked, although the associations didn't, as you may expect.
But I can't seem to get the bindings correct to work with the queryable, which I have declared like this:
I'm fairly sure I've tried all kinds of datasource and itemssource binding combinations, but I just cannot figure out where I've gone wrong. I've tried for about 4 hours or so now and I've just stumped.
Does anyone have any idea of where I've strayed off the path?
I had a previously working RadDataGrid working based on an ObservableCollection, which I manually populated, as you would expect. Now I'm converting the app over to Data Access and I'm stumbling. I have the following code that creates the Fetch Strategy and if I look at the log it does generate the output I would expect from the foreach loops.
Telerik.OpenAccess.FetchOptimization.FetchStrategy fetchStrategy =
new
Telerik.OpenAccess.FetchOptimization.FetchStrategy();
fetchStrategy.LoadWith<SessionData>(ses => ses.sesAPISource);
fetchStrategy.LoadWith<LapData>(lap => lap.mapSessionIdLap);
fetchStrategy.LoadWith<TelemetryData>(tel => tel.mapLapIdTelemetry);
simData.sessionQueryable = from c
in
simData.fluentModelContext.fluentSessions
where c.sesAPISource ==
"MEMAPI"
select c;
//test the iteration through the dataset
foreach
(SessionData thesessions
in
simData.sessionQueryable)
{
logger.Trace(
"Session: "
+ thesessions.sesTime);
foreach
(LapData thelaps
in
thesessions.sesLapData)
{
logger.Trace(
"Lap: "
+ thelaps.ltLapNumber);
int
i = 0;
foreach
(TelemetryData thetel
in
thelaps.ltTelemetryData)
{
i++;
logger.Trace(
"Tel: "
+ thetel.telCurrentTime);
if
(i > 20)
break
; //there is a lot of them
}
}
}
Previously I had a datasource binding set to {Binding simData.sessionsList} and an itemssource to {Binding}, which worked fine. When I tried accessing the data directly with this: "simData.fluentModelContext.fluentSessions.ToList();" and bound the datasource to {Binding simData.fluentModelContext} and the itemssource to {Binding fluentSessions} that also worked, although the associations didn't, as you may expect.
But I can't seem to get the bindings correct to work with the queryable, which I have declared like this:
private
IQueryable<SessionData> sessionqueryable;
public
IQueryable<SessionData> sessionQueryable
{
get
{
return
sessionqueryable; }
set
{
if
(sessionqueryable == value)
return
; SetProperty(
ref
sessionqueryable, value); }
}
I'm fairly sure I've tried all kinds of datasource and itemssource binding combinations, but I just cannot figure out where I've gone wrong. I've tried for about 4 hours or so now and I've just stumped.
Does anyone have any idea of where I've strayed off the path?