Can't fire click blazor ui button

@page "/members"
@namespace Blazor.Web
@attribute [StreamRendering]

<PageTitle>Members</PageTitle>

<h1>Members</h1>

@if (Users == null)
{
<p><em>Loading...</em></p>
}
else
{
<FluentCard>
<FluentDataGrid Id="membersgrid" Items=@Users GridTemplateColumns="2fr 0.7fr 0.6fr 0.9fr 0.8fr 1.2fr 1fr 1fr 1fr 1.4fr 1.4fr 1.8fr" TGridItem=User>
<PropertyColumn Title="Movie in" Property="@(c => c!.CreatedAt.ToString("dd/MM/yy"))" Sortable="true" Align=Align.Start/>
<TemplateColumn Title="Actions" Align=Align.Center>
<FluentStack>
<FluentButton IconStart="@(new Icons.Regular.Size24.Eye())" Appearance="Appearance.Outline" @onclick=@(() => OpenMemberPaymentRecord(context)) />
<FluentButton IconStart="@(new Icons.Regular.Size24.Edit())" Appearance="Appearance.Outline" @onclick=@(() => {})/>
<FluentButton IconStart="@(new Icons.Regular.Size24.Delete())" Appearance="Appearance.Outline" @onclick=@(() => {})/>
</FluentStack>
</TemplateColumn>
</FluentDataGrid>
</FluentCard>
}
</FluentStack>
@page "/members"
@namespace Blazor.Web
@attribute [StreamRendering]

<PageTitle>Members</PageTitle>

<h1>Members</h1>

@if (Users == null)
{
<p><em>Loading...</em></p>
}
else
{
<FluentCard>
<FluentDataGrid Id="membersgrid" Items=@Users GridTemplateColumns="2fr 0.7fr 0.6fr 0.9fr 0.8fr 1.2fr 1fr 1fr 1fr 1.4fr 1.4fr 1.8fr" TGridItem=User>
<PropertyColumn Title="Movie in" Property="@(c => c!.CreatedAt.ToString("dd/MM/yy"))" Sortable="true" Align=Align.Start/>
<TemplateColumn Title="Actions" Align=Align.Center>
<FluentStack>
<FluentButton IconStart="@(new Icons.Regular.Size24.Eye())" Appearance="Appearance.Outline" @onclick=@(() => OpenMemberPaymentRecord(context)) />
<FluentButton IconStart="@(new Icons.Regular.Size24.Edit())" Appearance="Appearance.Outline" @onclick=@(() => {})/>
<FluentButton IconStart="@(new Icons.Regular.Size24.Delete())" Appearance="Appearance.Outline" @onclick=@(() => {})/>
</FluentStack>
</TemplateColumn>
</FluentDataGrid>
</FluentCard>
}
</FluentStack>
private async Task OpenMemberPaymentRecord(User userInfo)
{
await DialogService.ShowDialogAsync<MemberPaymentRecord>(userInfo, new DialogParameters()
{
Title = $"Hello {userInfo.FirstName}",
OnDialogResult = EventCallback.Factory.Create<DialogResult>(this, result => HandleDialog(result)),
PrimaryAction = "Yes",
PrimaryActionEnabled = false,
SecondaryAction = "No",
Width = "500px",
Height = "500px",
TrapFocus = true,
Modal = true,
});
}
private async Task OpenMemberPaymentRecord(User userInfo)
{
await DialogService.ShowDialogAsync<MemberPaymentRecord>(userInfo, new DialogParameters()
{
Title = $"Hello {userInfo.FirstName}",
OnDialogResult = EventCallback.Factory.Create<DialogResult>(this, result => HandleDialog(result)),
PrimaryAction = "Yes",
PrimaryActionEnabled = false,
SecondaryAction = "No",
Width = "500px",
Height = "500px",
TrapFocus = true,
Modal = true,
});
}
I put a breakpoint in the OpenMemberPaymentRecord but not thing thru
1 Reply
jimbo
jimbo14mo ago
Try doing OnClick="@(() => OpenMemberPaymentRecord(context))" instead of @onclick. Seems to be what the docs for Fluent UI are saying to use.

Did you find this page helpful?