FlexGrid for WinForms | ComponentOne
C1.Win.C1FlexGrid Namespace / C1FlexGridBase Class / AllowAddNew Property

In This Topic
    AllowAddNew Property (C1FlexGridBase)
    In This Topic
    Gets or sets whether the grid should display a new row template after the last data row.
    Public Property AllowAddNew As Boolean
    public bool AllowAddNew {get; set;}

    If the user enters data into the new row template, a new row is automatically added to the grid.

    This property works in bound mode (if the data source supports adding new rows) and also in unbound mode.

    Note that if this property is set to true, the Rows.Count property will return a value that includes the new row template. If you set the Rows.Count property, the grid will set the number of data rows and will automatically add the new row template. For example:

    flex.AllowAddNew = true; flex.Rows.Count = 10; Console.WriteLine("Row count is {0}.", _flex.Rows.Count); Row count is 11.
    See Also