Form with Datagrid with CRUD

Good morning.

So I'm a long term Lightswitch user and am finally getting time over this Christmas period to take a look at Radzen. One of the features I used a lot in Lightswitch was having form controls at the top of a screen and then had children records in a datagrid below.

I was wondering if anyone has a walk through on how to achieve this in Radzen? I can't see a scaffolding template that does this automatically. I don't really know any Angular and have a lot to learn in that space I guess but wondered if someone could get me along the way with an example.

I'd like to do this on a create and edit page. I don't want to have to create a header record to then create the children. I hope that makes sense.

Thank you,
Paul.

Hi Paul,

Something like displaying OrderDetails when you edit an Order? If you auto-generate pages using our Sample database for MS SQL data source you will have Edit Order page with a Form component. You can place for example DataGrid bellow the Form and bind it to OrderDetails related to the edited Order.

Best Regards,
Vladimir

Hi Vladimir,

Yeah, that's the kind of scenario I have in mind.

I have added a grid as suggested. I can see that I can bind it to getOrderDetails but I cannot see where there is a choice for (for example) for getOrderDetailsByOrderId. So when I bind it to getOrderDetails, I get all order details and not the ones specifically for this order.

I'm also wondering how, when the user presses the add button on the order details grid, the new record is automatically bound to the current order.

Cheers :slight_smile:

Paul

Hi Paul,

You can add $filter parameter to getOrderDetails to
filter OrderDetails by Order Id. You can also invoke methods like create again by passing Order Id.

Best Regards,
Vladimir

The idea is described in detail in this post: Master/Detail Sample

1 Like