Hello,
I am trying to figure out how to use Blazor Grid Master-Detail nested grid within a grid whose data is populated by an Entity Instant Feedback Source. I can't get it working, due to the following failure:
Call Stackwarn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Unable to cast object of type 'DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread' to type 'MasterDetail.Models.Customer'.
System.InvalidCastException: Unable to cast object of type 'DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread' to type 'MasterDetail.Models.Customer'.
at MasterDetail.Pages.WithInstantFeedbackSource.<>cDisplayClass00.<BuildRenderTree>b3(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at DevExpress.Blazor.Internal.GridDetailRow.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'IDce9jsv7DaqTGUKZWZrTLQSqHOLHHivIzAggiyu4'.
System.InvalidCastException: Unable to cast object of type 'DevExpress.Data.Async.Helpers.ReadonlyThreadSafeProxyForObjectFromAnotherThread' to type 'MasterDetail.Models.Customer'.
at MasterDetail.Pages.WithInstantFeedbackSource.<>cDisplayClass00.<BuildRenderTree>b3(RenderTreeBuilder builder2)
at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
at DevExpress.Blazor.Internal.GridDetailRow.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
I can't find any documentation that suggests EntityInstantFeedbackSource
cannot be used with DetailRowTemplate
(I do not see it itemized under the Blazor Grid server modes limitations documentation), but due to other limitations I am worried that is the case. I forked the demo example and made the following changes:
- The master-detail rows now display
Orders
instead ofInvoices
as the relationship betweenCustomer
andOrder
matches closer to my implementation thanCustomer
andInvoice
- The
Index.razor
implementation does NOT use Instant Feedback Source, but was updated to reference/hydrate orders instead of Invoice lookup - The new
WithInstantFeedbackSource.razor
(/with-instant-feedback-source
) page mimics theIndex.razor
page exactly, except uses theEntityInstantFeedbackSource
object to display data instead of the in-memory cachedMasterGridData
enumerable
Can you take a look and let me know if this is possible, and if it is possible how we would refactor WithInstantFeedbackSource.razor
to do this?
Thank you!