HI Naresh ,
Thank you for your interest in Syncfusion products.
We would like to help you by our UG link given below, by all means it will resolve your reported query.
UG Link: http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!documents/throughcode3.htm
Please let us know, if you have any further concerns.
Regards,
ManiRatheenam S
Hi Naresh,
Thank you for your patience.
Query: Insert new data in
GridDataBoundGrid |
We would like to let you know that since the reported
query can be viewed in many perspective. So, we have come up with solution
which might resolve your reported query. 1.
To perform any changes in the GridDatabound
control, you can make use of CommitChanges method and DirectSaveCellInfo
property. Followinng codesnippet given below, CODESNIPPET[C#] this.gridDataBoundGrid1.CommitChanges(); this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = true; Use 2.
SaveCellInfo Event This
event is used to store data back into your data source when it has been
changed by the user. For your better convenience, we have provided an UG Link
below, http://help.syncfusion.com/ug/windows%20forms/grid/default.htm#!Documents/savecellinfoevent.htm 3.
If you are in need of save changes made in
GridDataBound into database, then do refer the following procedure, When
the user makes changes in the grid, like editing a row, deleting a row or
adding a new row, these changes are immediately saved in
the bound data set. There are two ways in which changes can be saved to the
underlying database. Option 1: It is
standard practice to include a Save button (or some other UI element) in the
page which could be used by the user to confirm all the changes. And in the
event handler for the Save button, you can call Update on the data adapter to
force changes into the database: CODESNIPPET[C#] this.oleDbDataAdapter1.Update(this.dataSetCustomers1); Option 2: If
the changes need to be saved into the database as soon as the user is done
editing a row, deleting a row or adding a new row, then you can listen to the
following events and call Update on the data adapter, as shown:
CODESNIPPET[C#] // This will be called when the user edits or adds a new
row. private void
GridGroupingControl1_CurrentRecordContextChange(object sender,
Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e) { if(e.Action == CurrentRecordAction.EndEditComplete) { this.oleDbDataAdapter1.Update(this.dataSetCustomers1); } } // This will be called when the user deletes a row private void GridGroupingControl1_BarButtonItemClicked(object
source,
Syncfusion.Web.UI.WebControls.Grid.Grouping.ButtonBarItemClickEventArgs e) { if(e.ButtonBarItem.ButtonBarItemType==ButtonBarItemType.DeleteRow) { { Record curRecord =
this.GridGroupingControl1.Table.CurrentRecord; curRecord.Delete(); this.oleDbDataAdapter1.Update(this.dataSetCustomers1); } } } The above code is
done using GridGrouping, you can perform the same using any of the
gridcontrols. |
Please let us know, if you have any further concerns.
Regards,
ManiRatheenam S