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

How do I set focus off the grid

Hi, I do have a GridDataBoundGrid and I do display data in it. When I click on a button (Edit) I turn the EnableEdit ON and I move the the top-left cell and set the focus on the grid. The cell becomes active ( I guess I do thing correctly) If I want to go back in Lookup mode, I press the Lookup button on my form, clear the grid (clearing the data source) but sometimes a value still remain in the current cell or the current cell still stays active. How do I remove the focus off of the current cell ?

1 Reply

AD Administrator Syncfusion Team August 18, 2003 07:03 PM UTC

By clearing the DataSource, do you mean soing something like: myDataTable.Rows.Clear(); to remove all rows from the underlying datatable that is the DataSource for the grid? If so, before doing that, also try calling: this.grid.CurrentCell.EndEdit(); this.grid.Binder.EndEdit(); You may have to condifitionally call these EndEdit by first checking grid.CurrentCell.IsEditing and grid.Binder.IsEditing.

Loader.
Up arrow icon