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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding Rows To GridDataBoundGrid

Thread ID:





47148 Jul 28,2006 01:44 PM UTC Aug 4,2006 05:13 AM UTC WinForms 3
Tags: GridControl
Marek Solarski
Asked On July 28, 2006 01:44 PM UTC


How Can I through code add new record to DataBoundGrid. Grid has EnableAddNew = true.
Adding new rows is to be prohibited until some key is pressed. I tried


But no record is added.

Thank you for your help.


Administrator [Syncfusion]
Replied On July 31, 2006 11:23 AM UTC

Hi Marek,

The GridDataBoundGrid doesn''t holds any data of its own as it shows the data from the underlying datasource.
So, to add a new record to the GridDataBoundGrid, you need to add the record to underlying datatable to reflect the changes in the grid.
Please refer the sample attached.

Srividhya R


Marek Solarski
Replied On August 3, 2006 01:39 PM UTC

Hi Srividhya,

Thank you for your answer.

If I need to add records to the underlying datasource I must have some values. But I''d like the user to enter then. How can I allow user entering new values? I want enableAddNew to be set to false in order to avoid two empty records(entered by user and the second empty).

Is there posibility to add new record not at the bottom of the grid but in the middle?


Administrator [Syncfusion]
Replied On August 4, 2006 05:13 AM UTC

Hi Marek,

The GridDataBoundGrid only displays what is presented to it by its datasource. So, if you want to add a row in the middle of the grid, then you would have to some how add a row in the middle of your datasource.

If the datasource is a DataTable, then you could try calling datatable1.NewRow to get a new row, populate it the way you want, call datatable1.Rows.InsertAt to insert the row and then call datatable1.AcceptChanges to make the new row appear where you inserted it. But, there is no way to do this directly from the grid.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon