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

Commiting Row Changes to datatable

Thread ID:





60202 Apr 30,2007 04:47 PM UTC May 1,2007 03:39 PM UTC WinForms 4
Tags: GridControl
Asked On April 30, 2007 04:47 PM UTC

I am trying to commit the changes made to a data table once the user clicks a PushButton. The fields are all static until the user clicks the modify pushbutton. From there I used this code to change the static fileds using the Prepare View Style Info Event

if(e.RowIndex > 0)
if(e.RowIndex == this._rowIndex && e.ColIndex == this.gridDataBoundGrid1.GridBoundColumns.IndexOf(this.gridBoundColumnQty)+ 1)
this.gridDataBoundGrid1.Model.IgnoreReadOnly = true;
e.Style.Clickable = true;
e.Style.ReadOnly = false;
e.Style.Enabled = true;
e.Style.CellType = "NumericUpDown";
e.Style.NumericUpDown = new GridNumericUpDownCellInfo(1,100000,100,1,true);
e.Style.CellAppearance = Syncfusion.Windows.Forms.Grid.GridCellAppearance.Raised;

this.gridDataBoundGrid1.Model.IgnoreReadOnly = false;

e.Style.Clickable = false;
e.Style.ReadOnly = true;
e.Style.Enabled = false;
e.Style.CellType = "Static";

However what this does is it is saving the changes into the datatable before I hit the commit button. How can I prevent this? It looks like it is making the cells editable.


Replied On April 30, 2007 05:17 PM UTC

I forgot to add I am using a GDBG control

haneefm [Syncfusion]
Replied On April 30, 2007 05:39 PM UTC

Hi John,

By Defalut, The CauseValidation property of any control is TRUE. It indicates whether the control can cause validation to be performed on any controls that require validation when it receives the focus.

In such scenario the grid's Validate method will get called which then will commit changes in the grid to the underlying datasource. So you need to set the CauseValidation property of the Button control ( CommitButton ) to FALSE.

this.commitButton.CauseValidation = false;

Best regards,

Replied On April 30, 2007 06:11 PM UTC

Ok I included a example of what I am trying to acomplish. I actually don't mind having the row become editable. Is there a way to revert back to the old values after the user clicks a GBDG PushButton?



Replied On May 1, 2007 03:39 PM UTC

NVM Figured it out by using CancelEdit for the model and current Cell to reset values


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

or the page will be automatically redirected to 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