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.

Cannot save grid control cell data - Please help!

Thread ID:

Created:

Updated:

Platform:

Replies:

54874 Jan 18,2007 05:19 PM Jan 19,2007 03:31 PM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 18, 2007 05:19 PM

In the grid control, when I am in the cell editing it and if I don't tab out of the cell, the cell information does not get saved or refreshed. If I am in the cell in edit mode, I cannot save the cell information. Please advise at to which property or event I need to capture. Thanks.


Administrator [Syncfusion]
Replied On January 18, 2007 06:31 PM

Hi Matt ,

Do you want to save the cell data in editing mode? If yes, try calling the CurrentCell.EndEdit followed by the Model.EndEdit method in a CurrentCellChanged event. Here is a code snippet.

this.gridControl1.CurrentCellChanged +=new EventHandler(gridDataBoundGrid1_CurrentCellChanged);

private void gridControl1_CurrentCellChanged(object sender, EventArgs e)
{
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;
object editState = cc.Renderer.GetEditState();
cc.EndEdit();
grid.Model.EndEdit();
cc.Renderer.SetEditState(editState);
}

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 18, 2007 06:48 PM

Thanks Haneef,

I don't have to save cell data in the middle of an edit. If a user chooses to make a change or add data to only one cell and click on save button, for now if the cell has focus, and if they are still in the cell, it will not save the data. I will try the handler you have here and see if that works for me. Thanks. Let me know if you have any other thoughts.

Matt.

>In the grid control, when I am in the cell editing it and if I don't tab out of the cell, the cell information does not get saved or refreshed. If I am in the cell in edit mode, I cannot save the cell information. Please advise at to which property or event I need to capture. Thanks.


Administrator [Syncfusion]
Replied On January 19, 2007 03:20 PM

Haneef,

I have a quick question. the event fires up everytime you enter anything in the cell. So for example, If I am entering a word, it takes a while since the event fires up. Is there an event that fires after I am done entering my data and reading the grid cell data? Thanks for you help.

Matt

>In the grid control, when I am in the cell editing it and if I don't tab out of the cell, the cell information does not get saved or refreshed. If I am in the cell in edit mode, I cannot save the cell information. Please advise at to which property or event I need to capture. Thanks.


Administrator [Syncfusion]
Replied On January 19, 2007 03:31 PM

Hi Matt,

Please try the attached sample and let me know if you are looking something different.
GCEndEditDemo.zip

Best Regards,
Haneef

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.

;