Hello,
In my DataBoundGrid I am trapping the "ModelSaveCellInfo" event to manually save the data from the cell back to the collection associated to my Grid and all is working well. Ok now if I click on a cell and make a change then click on a Button (or any other control) on my form the control in the cell looses focus. What I would like to do is when the control in the grid cell looses focus push the changes from the control back to the associated datasource (collection). I have tried this by trapping "CurrentCellControlLostFocus" but it doesn''t pass the row/column as does the "Mode3lSaveCellInfo" event.
Any help would be appreciated.
Thanks,
Rob Panosh
AD
Administrator
Syncfusion Team
March 18, 2004 12:35 PM UTC
Hi Rob,
try setting CausesValidation = true for the button. This will then trigger a Validate call on the grid which then triggers a SaveCellInfo.
Stefan
>Hello,
>
>In my DataBoundGrid I am trapping the "ModelSaveCellInfo" event to manually save the data from the cell back to the collection associated to my Grid and all is working well. Ok now if I click on a cell and make a change then click on a Button (or any other control) on my form the control in the cell looses focus. What I would like to do is when the control in the grid cell looses focus push the changes from the control back to the associated datasource (collection). I have tried this by trapping "CurrentCellControlLostFocus" but it doesn''t pass the row/column as does the "Mode3lSaveCellInfo" event.
>
>Any help would be appreciated.
>
>Thanks,
>Rob Panosh
AD
Administrator
Syncfusion Team
March 18, 2004 12:48 PM UTC
Stephan,
It is a little more complicated then that... My grid is on a tab page and when the user clicks outside the tab page I would like to trigger the SaveCellInfo event. Is there a way to trigger this evnet in the "CurrentCellControlLostFocus" event?
Thanks,
Rob
>Hi Rob,
>
>try setting CausesValidation = true for the button. This will then trigger a Validate call on the grid which then triggers a SaveCellInfo.
>
>Stefan
>
>>Hello,
>>
>>In my DataBoundGrid I am trapping the "ModelSaveCellInfo" event to manually save the data from the cell back to the collection associated to my Grid and all is working well. Ok now if I click on a cell and make a change then click on a Button (or any other control) on my form the control in the cell looses focus. What I would like to do is when the control in the grid cell looses focus push the changes from the control back to the associated datasource (collection). I have tried this by trapping "CurrentCellControlLostFocus" but it doesn''t pass the row/column as does the "Mode3lSaveCellInfo" event.
>>
>>Any help would be appreciated.
>>
>>Thanks,
>>Rob Panosh
AD
Administrator
Syncfusion Team
March 18, 2004 03:58 PM UTC
Try calling grid.CurrentCell.ConfirmChanges from CurrentCellControlLostFocus to see if that does what you need.
RP
Rob Panosh
March 18, 2004 04:28 PM UTC
Clay,
Thanks that worked. This also works grid.Model.EndEdit(). Should I use one over the other?
Thanks,
Rob
>Try calling grid.CurrentCell.ConfirmChanges from CurrentCellControlLostFocus to see if that does what you need.
AD
Administrator
Syncfusion Team
March 18, 2004 05:26 PM UTC
Model.EndEdit checks to see if the grid has a CurrentCell, and if it does, it calls CurrentCell.EndEdit. So, I do not think it matters which you use since you know you have a current cell when the cell control loses focus (I think).