Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
0
Disable Editiing in a specific row on IgbDataGrid
posted

Hi All!

I would like to know if it´s possible to disable a Row from the DataGrid from being edited, I saw there´s some solutions for JQuery but I can´t find anything for Blazor

Thank you so much!

  • 7375
    Offline posted

    Hello ,

    Thank you for the post . Yes you can ‘IsEditable’ false to specific row, although there is no direct "Row" in the Blazor grid, You need to toggle the Editable property on the column.

    You can't enter edit mode unless a cell is activated ,so you can hook OnActiveCellChanged event to control the column's Editable property.

    On the column you can set name property to get the column .

    <IgbTextColumn Name="Name" Field="Name" Width="@("*>150")"  />

    private void OnActiveCellChanged(IgbGridActiveCellChangedEventArgs e)
        {

            var columnName = e.NewActiveCell.ColumnUniqueKey;       

    In OnActiveCellChanged event, using columnName you should be able to get the column from the grid's Columns collection, and set the columns ‘IsEditable’ to false.