Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

357
Vistas
Blazor - AntDesign: Open Popover of a selected tableRow with the right mouse click

I am using an AntDesign Table with a selction. If I select a person, and use the right mouse click I want to show the popover of the selected row. I have already disabled the context menu if I use the right mouse click.

How is it possible to show excactly the popover of the selected row?

 <div oncontextmenu="return false;" @onmouseup="HandleMouseUp">
    <AntDesign.Table DataSource="@persons" TItem="Person" @bind-SelectedRows="@selectedRows">
        <Selection Key="@(context.Id.ToString())"/>
        <Column Title="Name">
            @(context.Name)
        </Column>
        <Column Title="Surname">
            @(context.Surname)
        </Column>     
        <ActionColumn Title="Settings">
            <Popover Trigger="@(new Trigger[] { Trigger.Click})">
                <ContentTemplate>
                    <Button Type="@ButtonType.Text"  @onclick="@(() => DeletePersonAsync(context))" />
                        Delete
                    </Button>
                </ContentTemplate>
                <ChildContent>
                     <Button type="primary" @onclick="@(() => HandleMoreActionsClicked(context))">Actions</Button>
                </ChildContent>
            </Popover>
        </ActionColumn>
    </AntDesign.Table>          
</div>

@code
{
    private List<Person> persons = new();
    private IEnumerable<Person> selectedRows = new();

protected override void OnInitialized()
{
    persons = GetListOfPersons();
}

private void HandleMouseUp(MouseEventArgs args)
{
    if (args.Button == 2)
    {
        if(selectedRows.Count() == 0)
        {
            return;
        }
        else if(selectedRows.Count() == 1)
        {
            var currentRow = selectedRows.First();
            //open Popover for this row
        }
        else
        {
            //TODO
        }
    }
        
}

private async Task DeletePersonAsync(Person person)
{
    await Client.DeletePersonAsync(person);
}

private void HandleMoreActionsClicked(Person clickedRowItem)
{
    if (!selectedRows.Any(r => r.Id == clickedRowItem.Id))
    {
        selectedRows = new List<Person> { clickedRowItem };
    }
}

}

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda