Customizing generated application

Various parts of the generated application by Radzen can be customized without breaking the app continuous regeneration. To do this you can use your favorite code editor, for example Visual Studio Code.

Customizing the Angular code

The code of each page in the generated Angular application is separated in three files. [PAGE-NAME].component.ts, [PAGE-NAME].component.html and [PAGE-NAME]-generated.component.ts. You can add additional code and/or other customizations to [PAGE-NAME].component.ts file only. For example with custom code please visit Image preview and Custom Component articles in our documentation.

Customizing the ASP.NET Core code

When you add Microsoft SQL Server, MySQL and/or PostgreSQL data-source, Radzen will generate ASP.NET Core server-side application. Pages are represented by MVC Controllers and you can customize every controller read, add, update and delete operation using C# partial classes and methods.

public partial class CategoriesController
{
    partial void OnCategoriesRead(ref IQueryable<Category> items)
    {
        // 
    }

    partial void OnCategoryDeleted(Category item)
    {
        // 
    }

    partial void OnCategoryUpdated(Category item)
    {
        // 
    }

    partial void OnCategoryCreated(Category item)
    {
        // 
    }
}
Public Partial Class CategoriesController
    Private Partial Sub OnCategoriesRead(ByRef items As IQueryable(Of Category))
    End Sub

    Private Partial Sub OnCategoryDeleted(ByVal item As Category)
    End Sub

    Private Partial Sub OnCategoryUpdated(ByVal item As Category)
    End Sub

    Private Partial Sub OnCategoryCreated(ByVal item As Category)
    End Sub
End Class

The execution of Microsoft SQL Server stored procedures can be extended as well.

Infer Northwind stored procedures

Invoke getCustOrderHists on button click without parameter and bind DataGrid to result

Create CustOrderHistsController partial class, provide default value for CustomerID parameter and filter the result

Set default value for parameters

public partial class CustOrderHistsController
{
    partial void OnCustOrderHistsDefaultParams(ref string CustomerID)
    {
        CustomerID = "AROUT";
    }

    partial void OnCustOrderHistsInvoke(ref IQueryable<CustOrderHist> items)
    {
        items = items.Where(i => i.Total > 25);
    }
}
Public Partial Class CustOrderHistsController
    Private Partial Sub OnCustOrderHistsDefaultParams(ByRef CustomerID As String)
        CustomerID = "AROUT"
    End Sub

    Private Partial Sub OnCustOrderHistsInvoke(ByRef items As IQueryable(Of CustOrderHist))
        items = items.Where(Function(i) i.Total > 25)
    End Sub
End Class

Run the application

For example how to invoke custom server-side method please visit Invoke custom server-side method article. For example how to extend server authenticated please visit Authentication and Authorization article.

Get Radzen

Sign-up to download the free 30-day Radzen trial.