Downloading Grid as CSV

Hello, I'm exposing Swagger.json file to RadzenPro Tool for DATA and for DB Data I'm making API calls. All the Demos/Examples I saw were using SQl server on the tool and are for Blazor ServerSide. Need bit suggestion on how i might get this to working with API Calls and on WebAssembly

The ExportController that is part of every generated application by Radzen can be used with any data. You can check the code in your app for reference:

Here is how we use it with EF DbContext:

1 Like

@enchev Thanks for the reply. I'm using WebAssembly. All my razor/razor.cs files are in client project and Controllers are in Server Project which I cant refer to. I tried manipulating client csproj <Compile Include="../server/Controllers/**" /> and also tried adding required NuGet packages, but some of nuget packages are not compatible with client project as its of framework 2.1standard

Exporting should be performed server side, not client side.

yes. I agree exporting should be done on Server side. But Client cant access classes/methods of Server project. Is there a way or work around so that client/razor.cs can access ExportController of Server project

No this isn't possible in Blazor WebAssembly projects. The server is a separate process from the client. All communication is done via HTTP requests.

Why do you need that? The way exporting works is by sending a HTTP request to the export controller which returns a file as a response which is then download by the browser.

Thanks. I was able to achieve through HTTP request but not able to download file on to browser. Should i be invoking JavaScript to Download in WebAssembly?

Radzen uses the NavigationManager (with second parameter set to true). It is injected in all pages as UrlHelper.

Thanks for the help. Was able to achieve this in WebAssembly