Getting parent context in child DataGrid

Hello Radzen Dev Team!
I just can’t solve the following problem:
In the child table, the button for adding records is located in the filtering template (it’s more convenient)
But I just can’t get the parent context in the event of pressing this button.
Another button, not located in the filtering template, successfully sees the parent context.
I added an attribute for the child table that takes the parent context, but for some reason it only returns the context of the last active child table.


Code and markup:

Hi Ivan,

The first button (that works) is in the DataGrid Template where parent data item is available as context. The second button which is in the child grid column FilterTemplate cannot access parent data context - there is not context for this template since there is no data item.

It turns out, you can’t get the parent context in the template of the child table?

No, you can get only the child table context and only in templates related to data items (DataGrid Template, Column Template and EditTemplate).

1 Like

Sadly, the add records button inside the column heading looks much better than above the table.
In any case, I am impressed with the prompt response!