We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How Add new Record

Hello how i coud add a new record bellow a selected record??
Greetings Alejandro

1 Reply

VS Venkatesh Sundaram Syncfusion Team August 28, 2015 01:20 PM UTC

Hi Ale,

Thank you for your interest in Syncfusion product.

                                           

                                         Query


                               Insert Row in grid

Since DataBoundGrid is mapped with datasource  If you want to add the rows or columns to the GridDataBoundGrid Control, you have to add the columns in the  datasource which is mapped to GDBC. To accept all the changes in the datasource when add or delete the Row/Columns , you can use AcceptChanges() property .

Please refer the below code:

void GridDataBoundGrid1_CellClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)

{

if (e.MouseEventArgs.Button == MouseButtons.Right)

{

DataRow tableRow = table.NewRow();

table.Rows.InsertAt(tableRow, e.RowIndex); //To add the row

// table.Columns.Add(); //To add the column

table.AcceptChanges();   

this.GridDataBoundGrid1.Refresh();

}

}


Sample Link:

http://www.syncfusion.com/downloads/support/directtrac/143321/ze/GDBG_Add_new_row-637406240

Please let me know if you have any concern.

Regards,
Venkat.




Loader.
Live Chat Icon For mobile
Up arrow icon