Add a New Row in C1FlexGrid

Posted by: yuvaopens on 12 September 2017, 12:48 pm EST

  • Posted 12 September 2017, 12:48 pm EST

    Hello team,

    I'm having a C1 Flex Grid, I need to add one new row dynamically when user right click and select add new row or any other easy way .
  • Replied 13 September 2017, 3:36 am EST

    Hi,

    there are two possibilities:

    • call
      this.c1FlexGrid1.Rows.Insert(this.c1FlexGrid1.Row);
      to insert a row before the currently selected row.

    • set
      this.c1FlexGrid2.AllowAddNew = true;
      to add an additional empty row to the end of the grid. When the user enters data in this row, a new empty row is added automatically.



    See attached sample which shows boths approaches.
    FlexAddRow.zip

    Best regards

    Wolfgang
  • Replied 13 September 2017, 4:42 am EST

    Hi,

    For dynamically adding a new row in C1FlexGrid, as Wolfgang mentioned, you may use AllowAddNew property. This way user would see a blank row at the bottom of the grid, clicking on which a new row template would be added to the same.
    Also, you may apply Watermark to this newly added row using NewRowWatermark property, as shown in attached image and also format this new row using BeforeAddRow and AfterAddRow events.
    Also, a sample application has been uploaded for your reference, which can be downloaded using the following URL:
    https://www.dropbox.com/s/xz5aoo0uxic3we8/prj_C1FlexGridAddNewRow.zip?dl=0

    Thanks,
    Ruchir Agarwal
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels