This problem bothered me for several years, and maybe someone here knows a simple solution, since I just ran into it again.
QUESTION: Is there a way to make XtraGrid โforgetโ the current focused row index before a new (different) data source is assigned to the grid?
BACKGROUND We use XtraGrid as a kind of controller for what is displayed on another panel of multiprocessor Winform.
Now imagine a hypothetical scenario in which the XtraGrid data source continues to change according to the menu selection. Menu item 1 fills the grid with a list of today's dishes in the dining room: Id, Name. Menu item 2 fills the grid with a list of Clients that the user must call on that day: ID, Name. The important thing is that these are separate, separate data sources, and the grid data source is assigned and reassigned.
CRITICAL FACT ON THIS QUESTION: We want the FocusedRowChanged grid to be the only place where we delay the user's choice in the controller grid. We are a spaghetti-free shop. FocusedRowChanged is better than a click event because it also controls the keyboard. The line with focus contains the identifier of the detailed record that we need to extract from the database for display in panel No. 2. This works - most of the time.
: , , , . , ( ) - . , . Entrees, FocusedRowChanged , . . , , .
DevExpress - ( , ), GUID, FocusedRowChanged , GUID GUID , , . . .
, : XtraGrid "" , ?