DxDataGrid<T>.SingleSelectedDataRow Property

Specifies the selected data row.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public T SingleSelectedDataRow { get; set; }

Property Value

Type Description
T

A data row.

Remarks

Use the SingleSelectedDataRow property to specify the selected data row.

NOTE

Set the SelectionMode property to SingleSelectedDataRow to enable single row selection mode.

Data Grid - Single selected data row

<DxDataGrid Data="@DataSource"
    SelectionMode="DataGridSelectionMode.SingleSelectedDataRow"
    @bind-SingleSelectedDataRow="@SelectedProduct">
    ...
</DxDataGrid>

@code {
    IEnumerable<Product> DataSource;
    Product selectedProduct;

    public Product SelectedProduct { 
        get { return selectedProduct; }
        set {
            selectedProduct = value;
            ...
        } 
    }

    protected override void OnInitialized() {
        ...
        SelectedProduct = DataSource.First();
    }
}

Online Demo

Data Grid - Single Data Row Selection

See Also