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

Cannot save grid control cell data - Please help!

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.


4 Replies

AD Administrator Syncfusion Team January 18, 2007 11:31 PM UTC

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


AD Administrator Syncfusion Team January 18, 2007 11:48 PM UTC

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.



AD Administrator Syncfusion Team January 19, 2007 08:20 PM UTC

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.



AD Administrator Syncfusion Team January 19, 2007 08:31 PM UTC

Hi Matt,

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

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon