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. Image for the cookie policy date

How to make CurrentCell.IsModified still to false

Hi,

I have a problem that i cannot solve, please advice me. My application does this behaviour, after checking the checkbox column it will move to the next cell and set a value to it. After moving to the next cell i call CurrentCell.ConfirmChanges so it will make CurrentCell.IsModified to false. but why when on deactivating cell triggerred the CurrentCell.IsModified becomes true. in my understanding it should still false.

Thanks in advance
Wirawan

8 Replies

AD Administrator Syncfusion Team July 27, 2006 12:22 PM UTC

Hi Wirawan,

In general, If you call ConfirmChanges directly the current cell will remain in edit mode. Only CurrentCell.IsModified will be reset and changes are saved to the underlying style object. The attached sample implements the confirmchanges method. It works fine on my system which has " Essentail studio 4.2 + .Net Framework 1.1 And 2.0 + XP sp2" installed, and I am not able to see the mentioned issue here. Can you able to see the issue in the attached sample? Or can you please tell me how to reproduce the issue in the attached sample so that we can get back soon with a solution at the earliest.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GDBGIsModified_575c760c.zip

Thanks,
Haneef


IG I Gusti Ngurah Wirawan July 28, 2006 01:48 AM UTC


Thanks for your response Haneef,
I have attached the modified code here and I can replicate the issue on it.
Please advice me.

Regards,
Wirawan

GDBGIsModified.zip


AD Administrator Syncfusion Team July 28, 2006 04:50 AM UTC

Hi Wirawan,

Try calling the CurrentCell.Deactivate method before move the currentcell to right.

gridDataBoundGrid1[gridDataBoundGrid1.CurrentCell.RowIndex, 6].Text = "1000";
gridDataBoundGrid1.CurrentCell.Deactivate(false);
gridDataBoundGrid1.CurrentCell.MoveRight();
gridDataBoundGrid1.CurrentCell.ConfirmChanges();

Let me know if this helps.
Regards,
Haneef


IG I Gusti Ngurah Wirawan July 28, 2006 09:32 AM UTC

Hi Haneef,

I still found the same problem, please see in my attached file.

Regards,
Wirawan


GDBGIsModified-1.zip


AD Administrator Syncfusion Team July 28, 2006 11:27 AM UTC

Hi Wirawan,

I have contacted the development team regarding this issue and will be updating you soon.

Thanks for your patience.

Best Regards,
Haneef


IG I Gusti Ngurah Wirawan July 31, 2006 05:54 AM UTC

Thanks Haneef,

Cannot wait for the solution. :D

Regards,
Wirawan


AD Administrator Syncfusion Team July 31, 2006 08:57 AM UTC

Hi Wirawan,

Our apologies for the delay in response.

Calling ConfirmChanges() does set the CurrentCell.IsModified flag to false. But in the sample the ConfirmChanges() is called in between the GridCheckBoxCellRenderer MouseUp and OnClickedCheckBox events and in the OnClikedCheckBox event again the IsModified flag is set to true by the NotifyChanged() call.

To resolve this issue, you need to handle the CurrentCellChanged event. Here is a code snippet

void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
{
if (gridDataBoundGrid1.CurrentCell.ColIndex == 6 && codeChange)
{
gridDataBoundGrid1.CurrentCell.ConfirmChanges();
gridDataBoundGrid1.CurrentCell.EndEdit();
gridDataBoundGrid1.Binder.EndEdit();
codeChange = false;
}
}

Here is a modified sample.
http://www.syncfusion.com/Support/user/uploads/GDBGIsModified-1_5a12bf13.zip

Let me know if this helps.
Best Regards,
Haneef


IG I Gusti Ngurah Wirawan August 2, 2006 02:37 AM UTC

Thank you Haneef, It''s working.

Regards,
Wirawan

Loader.
Live Chat Icon For mobile
Up arrow icon