Compile Error: Type Expected

I’m getting this error on a coujple of pages, could you please point me in the right direction?

Starting Radzen.Server on port 4000
Connected to Radzen.Server
Waiting for any pending restore operations...
Restore complete.
Solution is up to date.
Opening project C:\Software Projects\Tbi\Tbi.sln
Finished building C:\Software Projects\Tbi\Tbi.csproj
System.ApplicationException: Radzen.Server.CompilationFailedException: C:\Software Projects\Tbi\Components\Pages\Tickets\ChooseStock.razor(997,27): error CS1031: Type expected
C:\Software Projects\Tbi\Components\Pages\Tickets\ChooseStock.razor(997,29): error CS0449: The 'class', 'struct', 'unmanaged', 'notnull', and 'default' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
C:\Software Projects\Tbi\Components\Pages\Tickets\ChooseStock.razor(550,101): error CS0311: The type 'Tbi.Data.Models.AvailableStock' cannot be used as type parameter 'TItem' in the generic type or method 'TypeInference.CreateRadzenDataGrid_0(RenderTreeBuilder, int, int, bool, int, bool, int, bool, int, bool, int, PopupRenderMode, int, FilterMode, int, int, int, bool, int, IEnumerable, int, LogicalFilterOperator, int, string, int, Density, int, bool, int, bool, int, bool, int, Action, int, RenderFragment)'. There is no implicit reference conversion from 'Tbi.Data.Models.AvailableStock' to '?'.
at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 186
at Radzen.Server.ProjectContext.Compile(Compilation compilation) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectContext.cs:line 221
at Radzen.Server.ProjectServer.Compile(String fileName, String source, RazorProjectEngine projectEngine) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectServer.cs:line 1785
at Radzen.Server.ProjectServer.CompilePage(String fileName, String source, RazorProjectEngine engine) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectServer.cs:line 961
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout) in D:\a\radzen-next\radzen-next\Radzen.Server\ProjectServer.cs:line 1251
at Radzen.Server.ProgramController.Render(RenderRequest request) in D:\a\radzen-next\radzen-next\Radzen.Server\ProgramController.cs:line 658
at Radzen.VisualStudio.HttpResponseMessageExtensions.d__1.MoveNext() in D:\a\radzen-next\radzen-next\Radzen.VisualStudio.Xaml\HttpResponseMessageExtensions.cs:line 30
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

Cheers

Reg

Hi @SolutionJ,

We would need the source of the problematic page in order to troubleshoot.

ChooseStock.razor.zip (3.2 KB)

Hi, here is one of the pages.

Many thanks

Hi @SolutionJ,

I tested the attached page but couldn't reproduce the problem. I have sent a screenshot from the IDE as a private message. Could you send us an up-to-date version of your app so we can troubleshoot further?

Ok, so I had update my config file to use Latest …

Setting it to 12.0 removed a lot of the messages, but still left the one I documented above. This turned out to be because I had left off the Titem = xxx property on a couple of datagrid columns, even though I use the property on the RadzenDataGrid tag itself (I was under the impression that, if quoted on the DataGrid tag it was not needed on each column). I’m finding the same thing in other pages…

Hi @SolutionJ,

What is 12.0? What config file did you update?

The project file in Visual Studio (2026). 12.0 refers to the version of c# to be used.

I am afraid that without reproduction we can't tell more. Sending us the complete application seems to be the only way as the page attached to this thread works without problems.

I’ll leave it now, thanks, I know how to get around it by just specifying TItem on every grid column as well as the grid itself.

Thanks for the help, much obliged…