[Closed] How to pass a parameter from DialogService in Radzen?

sblb 1,231 Reputation points
2023-06-04T19:18:31.9966667+00:00

Hi,

I would like to know how I can pass the Id developers.SuiviBEId in DialogService.OpenSideAsync
developers.SuiviBEId is a Id from the class SuiviBE.

<RadzenButton Text="Dialog on Side" ButtonStyle="ButtonStyle.Secondary" Click="@(args=> OpenSideDialog(developers.SuiviBEId))" />

  async Task OpenSideDialog(int actionId)
    {
        act.SuiviBEId = actionId;
        await DialogService.OpenSideAsync<Actions>($"Actions", options: new SideDialogOptions { CloseDialogOnOverlayClick = closeDialogOnOverlayClick, Position = position, ShowMask = showMask });
    }

The button Dialog on Side is put in parent table.

User's image

When I clicl Actions I open the datagrid ActionsItems from the page Actions and I want to rendering all actions from id 1 (eg) from parent table.
I've put the foreign key as below.

protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<ActionItem>()
                .HasOne(p => p.SuiviBE)
                .WithMany(b => b.ActionItems);
            
        }

Thanks is advance to your reply

Developer technologies | .NET | Blazor
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.