- Create a new Radzen application.
- Create a new SQL Server data source and press Create sample schema. Generate CRUD pages from the data source.
- Enable security and generate security pages.
- Delete the Edit Order Detail and Order Details pages.
- Open the Edit Order page.
- Select the Form component and delete teh
User Namefield. - Add a DataGrid component and bind it to the
getOrderDetailsdata source method with$filterparameter set toOrderId eq ${parameters.Id}and$expandset toProduct. - Autogenerate the columns.
- Set the Template of the Product Id column to
${data.Product?.ProductName}. Set the Title toProduct. - Check the AllowAdd DataGrid property.
- Check the AllowDelete DataGrid property.
- Handle the DataGrid Add event and open Add Order Detail as a dialog with parameter
OrderIdset to${parameters.Id} - Handle the DataGrid Delete event and invoke the
deleteOrderDetailmethod with parameterIdset to${event.Id}.
- Select the Form component and delete teh
- Open Add Order Detail page.
- Select the form component and remove the
Orderfield. - Go to the Events tab in the property grid. Replace the
${event}value of thesubmitevent parameter withObject.assign(${event}, {OrderId: ${parameters.OrderId}}). - Add a Then action that navigates back.
- Select the form component and remove the
- Open the Add Order page, select the form component and remove the
User Namefield. - Open the Edit Order page, select the form component and remove the
User Namefield. - Run. Open an order and add order detail. Stop to customize the generated code.
- Open generated application with your favorite edtor and add a new file called
OrdersController.custom.csnext toOrdersController.cs:using System.Security.Claims; using [APPLICATION_NAME].Models.[DATASOURCE_NAME]; namespace [APPLICATION_NAME].Controllers.[DATASOURCE_NAME] { public partial class OrdersController { partial void OnOrderCreated(Order item) { item.UserName = this.HttpContext.User.FindFirst(ClaimTypes.Name).Value; } } }
- Run application
-
Notifications
You must be signed in to change notification settings - Fork 3
akorchev/radzen-end-to-end-application
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published