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.
SIGN IN To post a reply.
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
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.
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.
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
Please try the attached sample and let me know if you are looking something different.
GCEndEditDemo.zip
Best Regards,
Haneef
SIGN IN To post a reply.
- 4 Replies
- 1 Participant
-
AD Administrator
- Jan 18, 2007 10:19 PM UTC
- Jan 19, 2007 08:31 PM UTC