Blazor data grid edit row by external button

Hello,

I want to put the focused (current) row or the selected row into edit mode by pressing a button outside the grid.

I've tried:

<Radzen.Blazor.RadzenButton Click="@Edit">Edit</Radzen.Blazor.RadzenButton>

public RadzenGrid transactionsGrid;

    public void EditRow(InputTransactionNotNull inputTransactionNotNull)
    {
        transactionsGrid.EditRow(inputTransactionNotNull);
    }

Any idea?

Best regards

Jürgen

Hi @juergen,

Please format your code as per the forum FAQ instructions.

The code of the Click handler of the button isn't provided and we don't know what it does.

Hi

sorry, 'm not so familiar with that, ok in this way?

''' test.razor '''
<Radzen.Blazor.RadzenButton Click="@Edit">Edit</Radzen.Blazor.RadzenButton>
''' test.razor '''

''' test.razor.cs'''
public RadzenGrid transactionsGrid;

    public void Edit(EventArgs e)
    {
       transactionsGrid.EditRow( **?????** );
    }

'''' test.razor.cs'''

Best regards

Jürgen

Hi @juergen,

There is no such term focused row in our DataGrid however you can get/set the selected row similar to this demo:

Hi Enchev,

I'll see and I'try.

Thanks a lot

Jürgen

Hi Enchev,

I've tried, but I can't bring the row / cell to edit from outside the grid row.

This is my button, outside the grid:

''' test.razor
<Radzen.Blazor.RadzenButton Context="currentInputTransactionNotNull" Click="@(args => EditRow(currentInputTransactionNotNull))">Edit</Radzen.Blazor.RadzenButton>
''' test.razor

Because the EditRow method only reveived a null row, I've tried giving the button the context, which seems not to work.

Any idea?

Best regards,

Jürgen


Thanks Vladimir,

this works.
Issue solved.

Regards,

Jürgen