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

Adding a new row on a bound grid

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?

1 Reply

AD Administrator Syncfusion Team September 22, 2004 08:06 AM

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

Live Chat Icon For mobile
Up arrow icon