EndEdit Focus issue

I''m trying to force an update of the underlieing dataset in a databoundgrid so I can perform some pre-event validation. The issue i''m having is that when I call this.grid.Binder.EndEdit(); this.grid.CurrentCell.EndEdit(); the focus is lost from the cell that currently has focus and focus is set to the first cell in the grid. I need a way to persist the data in the current cell and keep focus on that cell. Is there any way to achieve this? Cheers

4 Replies

ST stanleyj Syncfusion Team January 3, 2006 05:56 PM UTC

Hi Mike, If BeginEdit is called after update, will that work for you. this.grid.Binder.BeginEdit(); this.grid.CurrentCell.BeginEdit(); I do not see the currentcell focus being moved to first cell. What version of grid are you using? Best regards, Stanley


MN Mike Nohr January 3, 2006 06:15 PM UTC

This is the code i''m using: this.gdgMessages.Binder.BeginEdit(); this.gdgMessages.Binder.EndEdit(); this.gdgMessages.CurrentCell.BeginEdit(); this.gdgMessages.CurrentCell.EndEdit(); This seems to have resolved the changing of focus however it only seems to update the underlieing dataset on fields with checkboxes. The problem is that I have a text entry field if I type something new in that field without leaving that field I can''t seem to persist that data to the dataset. The above code doesn''t appear to achieve this. Any suggestions? I''m using grid 3.3.0.0


ST stanleyj Syncfusion Team January 4, 2006 09:30 AM UTC

Hi Mike, Try this way. this.gridDataBoundGrid1.CurrentCell.EndEdit(); this.gridDataBoundGrid1.Binder.EndEdit(); this.Adapter.Update(this.DataSet); this.gridDataBoundGrid1.Binder.BeginEdit(); this.gridDataBoundGrid1.CurrentCell.BeginEdit(); Let me know if you still find issues. Best regards, Stanley


MN Mike Nohr January 4, 2006 06:35 PM UTC

Thanks Stanley! Worked like a charm. One more question for ya... If I wanted to persist an entire rows worth of data instead of just a cell what might the syntax for that look like? Cheers Mike

Loader.
Up arrow icon