I have a list of tuples and want to display the data. I stepped over Radzen and think its DataGrid will help and even looks great. So with the help of the getting started page, I implemented Radzen in Visual Studio. I copied the code from the DataGrid example to my project. The three using directives do not work but that shouldn't be a problem, since I do not want to get data from a database but from a simple list of value tuples:
Tuples are awkward - they don't use properties but fields (RadzenDataGrid prefers properties). Also you can't get a tuple member by its name via reflection. tupleType.GetField("one") does not work - it has to be tupleType.GetField("Item1").
Still you can display your tuple collection like this (with some limitations listed below the code):
Hm, I implemented the grid in my real project now and found out, that radzen's default.css file affects the layout of the rest of my page. Without the file the grid is just an ugly table. I see two solutions:
Load default.css not in but only in . Is this possible?
Delete everything in default.css, that is not needed for the grid. But what is needed for the grid?
Try including the base version of the theme as per the documentation. You can also build your own theme from the source and exclude everything you don't need by modifying this file. After rebuilding the project the new themes should be in the wwwroot directory.
The base version delivers the same grid layout like without default.css.
I cloned the project, edited the _components.scss (on first try, I deleted everything but @import 'components/blazor/grid';) and tried to rebuild. I get the following three errors:
There are the same errors but with more information that may help you.
Projects to be restored are determined...
All projects are up to date for recovery.
The "excubo.webcompiler" tool (version 2.6.0) has been restored. Available commands: webcompiler
The restore was successful.
EXEC : error : The target selector was not found. [C:\Users\<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj]
Use "@extend .rz-button-md !optional" to avoid this error.
on line 595 of themes/components/blazor/_grid.scss
>> @extend .rz-button-md;
------------^
The "excubo.webcompiler" tool (version 2.6.0) was restored. Available commands: webcompiler
The recovery was successful.
C:\Users\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj(68,5): error MSB3073: The command "dotnet tool run webcompiler -r themes -o wwwroot/css -z disable -m disable -p disable" was terminated with the code 1.
EXEC : error : [C:\Users\<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj] An assembly specified in the application dependencies manifest (Excubo.WebCompiler.deps.json) was not found:
package: 'AutoprefixerHost', version: '3.0.3'.
path: 'lib/netstandard2.0/AutoprefixerHost.dll'.
C:\Users\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj(68,5): error MSB3073: The command "dotnet tool run webcompiler -r themes -o wwwroot/css -z disable -m disable -p disable" terminated with the code -2147450740.
Error during the build process.
EXEC : error : The target selector was not found. [C:\Users<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj]
C:\Users<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj(68,5): error MSB3073: The command "dotnet tool run webcompiler -r themes -o wwwroot/css -z disable -m disable -p disable" was terminated with the code 1.
EXEC : error : [C:\Users\<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj]
C:\Users<>\source\repos\radzen-blazor\Radzen.Blazor\Radzen.Blazor.csproj(68,5): error MSB3073: The command "dotnet tool run webcompiler -r themes -o wwwroot/css -z disable -m disable -p disable" was terminated with the code -2147450740.
I have undone the changes but it still did not work. So, I cloned again, did not touch anything and tried to build. That also did not work.
Here are my steps:
Go to github and clone the project with click on "Code" -> "Open with Visual Studio".
In Visual Studio set local location -> "Clone"
Double click Radzen.sln
"Build" -> "Build Solution"
Could the following describe the problem:
1>EXEC : error :
1> An assembly specified in the application dependencies manifest (Excubo.WebCompiler.deps.json) was not found:
1> package: 'AutoprefixerHost', version: '3.0.3'
1> path: 'lib/netstandard2.0/AutoprefixerHost.dll'
Unfortunately I don't know what is causing this problem. We are building the Radzen.Blazor project a few dozen times a day and this error has never happened. By the way you seem to have made it further by using command line. Try again with the command line.
OK, I am pretty sure, that my system is causing the problem. Unfortunately, I now only see the following option: Start app -> use browser dev tools to find out which radzen CSS classes are used -> copy these classes to my app.css (and modify if necessary) -> do not load radzen's default.css -> hope everything works.