The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a requirement where I need to add a new row at run time to my databound grid.
The requirement is very similar to the feature MS-Word provides with it''s tables. In those tables, as soon as you tab out of the last col of the last row, the table is added with a new row.
I found that there is a property called ''EnableAddRow'' on the data grid. But I was unable to use it. The help against it says that this property allows you to add a new row to the grid if the underlying datasource supports it.
Can you please explain how to achieve this funcitonality?
ADAdministrator Syncfusion Team September 22, 2004 01:06 PM UTC
When you set EnableAddNew = true then the grid will show a row at the bottom marked with an Asterisk.
Check out the RecordNavDataBound example, scroll to the bottom and see this row. The user can start typing in a cell in that row and a row will be added.
In order to programmatically add a row, you can call grid.Binder.AddNew(), change cell values and the call grid.Binder.EndEdit();
Or you could simple call
DataTable table;
table.Rows.Add(table.NewRow());
if your underlying datasource is a Ado.Net DataTable
Stefan