Design code for Blazor Components demo

Hi
I can see the source code for the Blazor components in github but I cant see the design time code that will allow me to use it in the designer. I have tried to import from MyApplications page but it says its not a Radzen project.

I'm trying to get to grips with the correct property/event settings for the components. I can see what goes on when the page/componenets are scafolded but it only has a subset of components. For example I am trying to replace a dropdown with a dropdowngrid but it refuses to work as I expect so looking for examples.

Is the full project available to download?

Many thanks for a great product.

Tim

What you see in Github is the full project and yes, it was not created with Radzen - it is a custom application.

I can see what goes on when the page/componenets are scafolded but it only has a subset of components.

What do you mean by a subset of components?

For example I am trying to replace a dropdown with a dropdowngrid but it refuses to work as I expect so looking for examples.

Can you elaborate what "refuses to work as I expect" means?

BTW Radzen will generate all dropdowns as DropDownDataGrid if you check the "Allow paging, sorting and filtering of lookup data" checkbox in the "Edit data source" screen.

I was looking for a CRUD page example that used the dropdowngrid but I think by default dropdown components are used which makes sense. I can replace the dropdown manually but I guess I must be failing to connect it correctly ie I can select an item from the grid when it pops up and it fills the field correctly but:
I cant get it to filter the list when I start typing and then the page hangs. I wait for 30 seconds or so not change.
I have many pages of data in the grid (5 items per page) if I click the > or >> to move to next page the grid closes. The < and << work ok

I then tried linking the dropdowngrid to a table that has only 10 items and the search worked for that ok (but the > >> buttons did not)

Here is how Radzen configures a DropDownDataGrid:

  1. Invokes a data source method and creates a page property

  2. Sets the Data and Value properties of the DropDownList
  3. Sets the TextProperty and ValueProperty.

Hi
Thanks for confirming, I have those correct. However I am getting an error when I try to search.
I have created a much simpler sample that kinda works but still having issues with > >> page arrows.
I'll build a simple sample and send it over and would appreciate if you can take a look.
Thanks

dotnet: info: Microsoft.EntityFrameworkCore.Database.Command[20100]
Executing DbCommand [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [s].[SectionID], [s].[CategoryForRandomQuestions], [s].[DisplayText], [s].[IncludeSubCatForRandomQuestions], [s].[IsIncluded], [s].[MoodleQuestionID], [s].[NumQuestions], [s].[PaperID], [s].[Pic1], [s].[Pic2], [s].[Pic3], [s].[QuestionCountForRandomQuestions], [s].[SectionBankID], [s].[SectionName], [s].[SectionNumber], [s].[SectionText], [s].[SortOrder], [s].[TagsForRandomQuestions], [p].[PaperID], [p].[BookCoversPath], [p].[BookDocPath], [p].[BookDocTemplatePath], [p].[CourseID], [p].[Description], [p].[DisplayText], [p].[DownloadDocPath], [p].[DownloadDocTemplatePath], [p].[Duration], [p].[ExtraDocPath], [p].[MoodleModuleID], [p].[MoodleQuizID], [p].[MoodleSubQuizID], [p].[Notes], [p].[NumQuestions], [p].[PaperFormatTypeID], [p].[PaperName], [p].[PaperNumber], [p].[PaperTypeID], [s0].[SectionBankID], [s0].[CategoryID], [s0].[DisplayText], [s0].[MoodleQuestionID], [s0].[MoodleQuestionUID], [s0].[Notes], [s0].[Pic1], [s0].[Pic1URL], [s0].[Pic2], [s0].[Pic2URL], [s0].[Pic3], [s0].[Pic3URL], [s0].[SectionName], [s0].[SectionNumber], [s0].[SectionText], [s0].[Tags], [s0].[WPMediaID1], [s0].[WPMediaID2], [s0].[WPMediaID3]
FROM [dbo].[Section] AS [s]
INNER JOIN [dbo].[Paper] AS [p] ON [s].[PaperID] = [p].[PaperID]
LEFT JOIN [dbo].[SectionBank] AS [s0] ON [s].[SectionBankID] = [s0].[SectionBankID]

dotnet: warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Expression of type 'System.Linq.IQueryable1[System.Object]' cannot be used for parameter of type 'System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section]' of method 'System.Linq.IQueryable1[Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]] Join[Section,Paper,Nullable1,TransparentIdentifier2](System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section], System.Collections.Generic.IEnumerable1[SwotBuilder.Models.SwotPaperBuilder.Paper], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Section,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Paper,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func3[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper,Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]]])' (Parameter 'arg0') System.ArgumentException: Expression of type 'System.Linq.IQueryable1[System.Object]' cannot be used for parameter of type 'System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section]' of method 'System.Linq.IQueryable1[Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]] Join[Section,Paper,Nullable1,TransparentIdentifier2](System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section], System.Collections.Generic.IEnumerable1[SwotBuilder.Models.SwotPaperBuilder.Paper], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Section,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Paper,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func3[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper,Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]]])' (Parameter 'arg0')
at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index)
at System.Linq.Expressions.Expression.Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.ExpandingExpressionVisitor.ExpandNavigation(Expression root, EntityReference entityReference, INavigation navigation, Boolean derivedTypeConversion)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.ExpandIncludesHelper(Expression root, EntityReference entityReference)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.ExpandInclude(Expression root, EntityReference entityReference)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.Visit(Expression expression)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeApplyingExpressionVisitor.Visit(Expression expression)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.ExpandAndReduce(Expression query, Boolean applyInclude)
at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.Expand(Expression query)
at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query)
at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_01.<Execute>b__0() at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression) at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Radzen.DataBoundFormComponent1.get_View()
at Radzen.Blazor.RadzenDropDownDataGrid`1.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

dotnet: fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'Ko3sgFR2Od9uElqEitVd1vrASGPzcDa_nik9mjlOebE'.
System.ArgumentException: Expression of type 'System.Linq.IQueryable1[System.Object]' cannot be used for parameter of type 'System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section]' of method 'System.Linq.IQueryable1[Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]] Join[Section,Paper,Nullable1,TransparentIdentifier2](System.Linq.IQueryable1[SwotBuilder.Models.SwotPaperBuilder.Section], System.Collections.Generic.IEnumerable1[SwotBuilder.Models.SwotPaperBuilder.Paper], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Section,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func2[SwotBuilder.Models.SwotPaperBuilder.Paper,System.Nullable1[System.Guid]]], System.Linq.Expressions.Expression1[System.Func3[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper,Microsoft.EntityFrameworkCore.Query.TransparentIdentifierFactory+TransparentIdentifier2[SwotBuilder.Models.SwotPaperBuilder.Section,SwotBuilder.Models.SwotPaperBuilder.Paper]]])' (Parameter 'arg0') at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index) at System.Linq.Expressions.Expression.Call(MethodInfo method, Expression arg0, Expression arg1, Expression arg2, Expression arg3, Expression arg4) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.ExpandingExpressionVisitor.ExpandNavigation(Expression root, EntityReference entityReference, INavigation navigation, Boolean derivedTypeConversion) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.ExpandIncludesHelper(Expression root, EntityReference entityReference) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.ExpandInclude(Expression root, EntityReference entityReference) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeExpandingExpressionVisitor.Visit(Expression expression) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.IncludeApplyingExpressionVisitor.Visit(Expression expression) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.ExpandAndReduce(Expression query, Boolean applyInclude) at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.Expand(Expression query) at Microsoft.EntityFrameworkCore.Query.QueryTranslationPreprocessor.Process(Expression query) at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query) at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_01.b__0()
at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func1 compiler) at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func1 compiler)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable1.GetEnumerator() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Radzen.DataBoundFormComponent1.get_View() at Radzen.Blazor.RadzenDropDownDataGrid1.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

There is an invalid cast exception which is causing the problem.

Can you show us the DropDownDataGrid configuration? We need a screenshots of the following:

  1. DropDownDataGrid properties - select it and screenshot the Property DataGrid.
  2. The Invoke Data Source action in the Load event of the Page
  3. The property initialized in the Then of the invoke from step 2.

Basically the equivalent of my screenshots.

Thanks, screenshots attachedDropDownTableError.zip (158.1 KB)

Update on < << pagination and item selection in dropdown and datagrid at runtime
In Edge anything outside the dialogbox container boundary is unselectable so you cant select an item outside the boundary includes pagination for wide/tall items.
In Chrome you can select them.

In both browsers the < << do not work correctly when going from page 2 to page 1, the dropdown closes without moving the page backwards.

The screenshots look correct so there must be something else.

Can you try something please? In a new application use the same database and generate CRUD pages. This time check the "Allow paging, sorting and filtering of lookup data" checkbox in the "Edit data source" screen. This should make Radzen automatically generate DropDownDataGrids instead of DropDowns. Are those working as expected in terms of filtering and paging?

Hi
Did as you asked, same error when trying to search.

paging issues as before for the dropdowngrid depending on browser

Really appreciating your help, thanks!

Further info:

Some simpler dropdowngrid do work when searching but then come up with other errors when clicking grid rows/searching/paging

dotnet: warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
Unhandled exception rendering component: Target object is not an ExpandoObject
System.InvalidOperationException: Target object is not an ExpandoObject
at System.Linq.Dynamic.Core.DynamicGetMemberBinder.FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
at System.Dynamic.DynamicMetaObject.BindGetMember(GetMemberBinder binder)
at System.Dynamic.GetMemberBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args)
at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter1.ComputeMap(TElement[] elements, Int32 count)
at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count, Int32 minIdx, Int32 maxIdx) at System.Linq.OrderedEnumerable1.GetEnumerator(Int32 minIdx, Int32 maxIdx)+MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Radzen.Blazor.RadzenGrid1.get_PagedView()
at Radzen.Blazor.RadzenGrid`1.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

dotnet: fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
Unhandled exception in circuit 'IIJhi_VlDrOqCi1SoYfQ0ncAvb6G9BiqbolrVbTSkNQ'.
System.InvalidOperationException: Target object is not an ExpandoObject
at System.Linq.Dynamic.Core.DynamicGetMemberBinder.FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
at System.Dynamic.DynamicMetaObject.BindGetMember(GetMemberBinder binder)
at System.Dynamic.GetMemberBinder.Bind(DynamicMetaObject target, DynamicMetaObject[] args)
at System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection1 parameters, LabelTarget returnLabel) at System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite1 site, Object[] args)
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Linq.EnumerableSorter2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter1.ComputeMap(TElement[] elements, Int32 count)
at System.Linq.EnumerableSorter1.Sort(TElement[] elements, Int32 count, Int32 minIdx, Int32 maxIdx) at System.Linq.OrderedEnumerable1.GetEnumerator(Int32 minIdx, Int32 maxIdx)+MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Radzen.Blazor.RadzenGrid1.get_PagedView()
at Radzen.Blazor.RadzenGrid`1.BuildRenderTree(RenderTreeBuilder __builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

dotnet: info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint '/_blazor'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 21479.7488ms 101

It seems the problem is deeper and could be somehow related to the database you are using. In order to troubleshoot further I am asking you to send us your database (either as a backup or SQL CREATE script) to info@radzen.com. Also send us the Radzen application. We will troubleshoot and report our findings.

I've dug a bit deeper in the Target object is not an ExpandoObject error - seems if I sort the dropdowngrid first then click in the search box and start typing I get the error.
I'll see if I can get the db over to you
Thanks

app with db sent, thanks!

Thank you! We reproduced the error and will follow up.