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.

Edit GGC cell not cause the datasource change

Thread ID:

Created:

Updated:

Platform:

Replies:

42580 Apr 1,2006 09:52 PM Aug 6,2006 01:17 PM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 1, 2006 09:52 PM

Hi, There In GGC, I noticed when you edit a cell content, leave to the next cell in the same row, the grid datasource (dataset) doesn''t change immediatly, only when I leave to next row, the dataset changes. This cause saving problem because I edit a cell, click the Save button, the code will check if the dataset has change, like mGridDataSet.HasChanges(), the datasource has no changes until you leave to the next row. How can I make the dataset changes whenever I edit a cell? Thanks Lan

Administrator [Syncfusion]
Replied On April 3, 2006 05:52 AM

Hi Lan, The problem you are facing is that, by default the new value is stirred in a local row cache and is being flushed to the datasource only when the row changes. If you want to do this on a cell by cell basis, then say in CurrentCellAcceptedChanges, first call EndEdit before you call Update. Here is the code snippet private void gridGroupingControl1_TableControlCurrentCellAcceptedChanges(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e) { this.gridGroupingControl1.Table.EndEdit(); this.sqlDataAdapter1.Update(this.dataSet11); } Best regards, Madhan

Administrator [Syncfusion]
Replied On April 12, 2006 09:34 AM

Hi Madhan, Thank you very much. It works for me. Regards, Lan >Hi Lan, > >The problem you are facing is that, by default the new value is stirred in a local row cache and is being flushed to the datasource only when the row changes. If you want to do this on a cell by cell basis, then say in CurrentCellAcceptedChanges, first call EndEdit before you call Update. > Here is the code snippet > > private void gridGroupingControl1_TableControlCurrentCellAcceptedChanges(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e) > { > this.gridGroupingControl1.Table.EndEdit(); > this.sqlDataAdapter1.Update(this.dataSet11); > } > >Best regards, >Madhan >

Administrator [Syncfusion]
Replied On August 4, 2006 04:32 PM

Hello Hadhan,
Now I got little problem for GroupingGridControl with Multiple Primary Keys table.
when I add a new row, enter first Primary key cell, leave the cell, this line ''this.gdBase.Table.EndEdit'' displays validation error Messagebox saying the second Primary Key cell can''t be null, when you click Messagebox''s OK, the content entered in the first Primary Key cell disappeared, the cursor moves to the second Primary Key cell. This makes you can never finish to enter a new row.
Please see two attached meesage files.
How can I get around? Thanks.

Lan Mo

my code:

private void gdBase_TableControlCurrentCellAcceptedChanges(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e)
{
// accept cell change
this.gdBase.Table.EndEdit();
DimButtons();
}

>Hi Madhan,
>Thank you very much. It works for me.
>Regards,
>
>Lan
>
>
>
>
>>Hi Lan,
>>
>>The problem you are facing is that, by default the new value is stirred in a local row cache and is being flushed to the datasource only when the row changes. If you want to do this on a cell by cell basis, then say in CurrentCellAcceptedChanges, first call EndEdit before you call Update.
>> Here is the code snippet
>>
>> private void gridGroupingControl1_TableControlCurrentCellAcceptedChanges(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e)
>> {
>> this.gridGroupingControl1.Table.EndEdit();
>> this.sqlDataAdapter1.Update(this.dataSet11);
>> }
>>
>>Best regards,
>>Madhan
>>

GridValidateMsg.zip

Administrator [Syncfusion]
Replied On August 6, 2006 01:17 PM

One possible solution is to not call this.gridGroupingControl1.Table.EndEdit()
every time you leave a cell. Instead, try calling it in your Save button code just before you check DataSet.HasChanges. This way you would not try to validate the record between entering one key and the second key.

CONFIRMATION

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.

;