Select theme:
Radzen Blazor Studio has replaced Radzen as the primary RAD tool for Blazor applications.
Radzen Blazor Studio offers a modern UI, enhanced features, and improved performance to streamline your development process.
The latest documentation for Radzen Blazor Studio is available here: https://www.radzen.com/blazor-studio/documentation/
Open Radzen Blazor Studio docsIn this step from the CRM Application tutorial we will customize the automatically scaffolded CRUD pages.
The contact is a paramount entity in the RadzenCRM application as everything depends on it - opportunities, tasks etc.
Let's add some contacts. We will use some famous members from the tech industry.
salesmanager@demo.radzen.com and SalesManager1@. Those are the credentials of the Jane Smith application user who is a Sales Manager (we added that user in the Customize security article).Bill, LastName: Gates, Email: bill.gates@microsoft.com (probably not his real email), Company: Microsoft.Elon, LastName: Musk, Email: elon.musk@tesla.com (maybe not real too), Company: Tesla.

The first thing we will do is associate the opportunity with the current user and filter the opportunities so:
We do that by customizing the server-side code of the Radzen application.
server\project.csproj with Vusual Studio (or the server directory with Visual Studio Code).server\Controllers\CRM\OpportunitiesController.Custom.cs with the following content.using System.Linq;
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
namespace RadzenCrm.Controllers.Crm
{
using Models.Crm;
[Authorize(AuthenticationSchemes = "Bearer")]
public partial class OpportunitiesController
{
partial void OnOpportunityCreated(Opportunity item)
{
var userId = User.FindFirst(ClaimTypes.NameIdentifier).Value;
// Set the UserId property of the opportunity to the current user's id
item.UserId = userId;
}
partial void OnOpportunitiesRead(ref IQueryable<Opportunity> items)
{
var role = User.FindFirst(ClaimTypes.Role).Value;
if (role != "Sales Manager")
{
var userId = User.FindFirst(ClaimTypes.NameIdentifier).Value;
// Filter the opportunities by the current user's id
items = items.Where(item => item.UserId == userId);
}
}
}
}
Since we are manually setting the UserId of the opportunity we should remove the corresponding form field from the Add Opportunity and Edit Opportunity pages.
Let's try if it worked!
salesmanager@demo.radzen.com and SalesManager1@.50000bill.gates@microsoft.comActive02/01/2019Microsoft dealYou should see this.

But what is that GUID in the User ID column? It is the Id of Jane Smith - the user we have logged in as. Let's display something more user-friendy than a GUID.
,User in the $expand parameter value. The $expand parameter is similar to a SQL JOIN (and in fact does exactly that behind the scenes). Click the Done button to close the Event Editor.${data.User.FirstName} ${data.User.LastName}.User.FirstName. This tells the DataGrid what property to sort by when the user changes the order by clicking the column header.

If you run the application now it should display the current user name instead of the GUID.

We will improve the look and feel of the Tasks page by using icons in the Task Status and Task Type DataGrid columns.
Run the application and add three tasks with the following properties
Introduction, Opportunity: Microsoft deal, Due Date: 02/02/2019, Task Type: Email, Task Status: Complete.Demonstration, Opportunity: Microsoft deal, Due Date: 03/06/2019, Task Type: Online Meeting, Task Status: In Progress.Negotiation, Opportunity: Microsoft deal, Due Date: 03/26/2019, Task Type: Call, Task Status: Not Started.
Now lets add the icons for the Task Type column.
${data.TaskType.Name}. 
settings_phone (click the ... button
to open the Icon Picker dialog). Set the Visible property to ${data.TaskType.Name == 'Call'}.
This icon will be visible only when the current task type is equal to Call.
. Go to the Style tab of the property grid and set VerticalAlign to middle.video_call and set the Visible property to ${data.TaskType.Name == 'Online Meeting'}. 
email and set the Visible
property to ${data.TaskType.Name == 'Email'}. 
The Tasks page should now look like this. ![]()
Do the same for the Task Status column.
${data.TaskStatus.Name}.check_circle (click the ... button
to open the Icon Picker dialog). Set the Visible property to ${data.TaskStatus.Name == 'Complete'}.
Go to the Style tab of the property grid and set VerticalAlign to middle.cancel and set the Visible property to ${data.TaskStatus.Name == 'Not Started'}.autorenew and set the Visible
property to ${data.TaskStatus.Name == 'In Progress'}.Here is how the end result should look like:

The final task from this help article is to add search capabilities to the Contacts page.
First we will add the search UI components - a TextBox and a Button.
${contactFilter}. Now when the user types in the TextBox the contactFilter property will update.Search.

this.grid0.load(). This will make the DataGrid component load when the user clicks the button.OR.Contains comparison and '${contactFilter}' value.
You can now search for contacts.

It is time to learn how to create a dashboard page with Radzen.
Radzen is free to use. You can also test the premium features for 15 days.
Start FreeSelect theme: