Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1510
Moving focus completely OUT of grid ( and cells inside grid ) after row insert
posted

Hi Mike!

Can you please tell me how I can move the focus FROM the grid after inserting a new row ...
There should be NOTHING selected inside the Grid after I've inserted the row ... the Grid shouldn't even be selected itself

I've tried various things and various events:
( e.g. AfterRowUpdated, AfterCellUpdated etc.... )

including:
_ugFinishDateChanges.Selected.Cells.Clear();
_ugFinishDateChanges.Selected.Rows.Clear();
and then right after:
_btnDelay.Focus(); // this is a button, OUTSIDE of the Grid

But there is still one cell selected/activated ...

I was looking for something like:
_ugFinishDateChanges.ActiveCell.Clear(); // this property does NOT exist though ...

I would think that everything inside the grid would be UNSELECTED/UnFocused simply by moving the focus to the button, which is NOT on the Grid ?

How come there's one cell ( the last cell I was in ) still "selected" ? The focus is now on the BUTTON, not the Grid ( correctly so )

I should note that I'm using this in the InitilizeLayout:

e.Layout.Override.AllowMultiCellOperations = Infragistics.Win.UltraWinGrid.

AllowMultiCellOperation.None;

e.Layout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.
SelectType.Single;
e.Layout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.
SelectType.Single;

I should also note that the focus DOES move to the button, but the cell I was in, inside the Grid is still "selected" too ( gray colored ). I want the Grid completely "CLEAN" ( no selections inside it )
And when I push that button, another cell becomes actived ( which is the correct behaviour )
because this button enters "edit mode" ( creates a new blank row in the datasource and rebinds the data with it ):
_ugFinishDateChanges.ActiveRow = _ugFinishDateChanges.Rows[0]; // this is working OK
_ugFinishDateChanges.Selected.Cells.Add(_ugFinishDateChanges.Rows[0].Cells[
"FinishDate"]); // this is working OK