menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DataGridAddNewRowController - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DataGridAddNewRowController

    Represents a controller class that manages the behavior and configuration of the AddNewRow feature in a SfDataGrid.

    Inheritance
    System.Object
    DataGridAddNewRowController
    Namespace: Syncfusion.Maui.DataGrid
    Assembly: Syncfusion.Maui.DataGrid.dll
    Syntax
    public class DataGridAddNewRowController : Object

    Constructors

    DataGridAddNewRowController(SfDataGrid)

    Initializes a new instance of the DataGridAddNewRowController class. This constructor sets up the controller with the specified SfDataGrid instance.

    Declaration
    public DataGridAddNewRowController(SfDataGrid grid)
    Parameters
    Type Name Description
    SfDataGrid grid

    The SfDataGrid instance to be managed by this controller.

    Methods

    AddNew(SfDataGrid)

    Adds a new row to the DataGrid if allowed, propagating the Add New event and handling the new row assignment and selection.

    Declaration
    public virtual bool AddNew(SfDataGrid dataGrid)
    Parameters
    Type Name Description
    SfDataGrid dataGrid

    The SfDataGrid instance in which to add a new row.

    Returns
    Type Description
    System.Boolean

    true if a row was added; otherwise, false.

    Exceptions
    Type Condition
    System.InvalidOperationException

    Thrown when an add operation is attempted while already in an add session.

    CancelAddNew()

    Cancels the add new row operation in the associated DataGrid and resets the "Add New Row" state.

    Declaration
    public virtual void CancelAddNew()

    CommitAddNew(SfDataGrid, Boolean)

    Commits the add new row operation on the given SfDataGrid instance, and updates the Add New Row label visibility if the current cell is on the add new row.

    Declaration
    public virtual void CommitAddNew(SfDataGrid dataGrid, bool changeState = true)
    Parameters
    Type Name Description
    SfDataGrid dataGrid

    The DataGrid on which to commit the add new row.

    System.Boolean changeState

    Whether to change row state; defaults to true.

    GetAddNewRowIndex(SfDataGrid)

    Retrieves the index of the AddNewRow in the specified SfDataGrid.

    Declaration
    public int GetAddNewRowIndex(SfDataGrid dataGrid)
    Parameters
    Type Name Description
    SfDataGrid dataGrid
    Returns
    Type Description
    System.Int32

    The index of the AddNewRow if available; otherwise -1.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved