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.
Unfortunately, activation email could not send to your email. Please try again.

Adding a new row on a bound grid

Thread ID:





19262 Sep 22,2004 06:05 AM Sep 22,2004 09:06 AM Windows Forms 1
Tags: GridControl
Asked On September 22, 2004 06:05 AM

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?

Administrator [Syncfusion]
Replied On September 22, 2004 09: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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.