How to make the contents of the DataGrid column (which is displayed as a TextBox) edited according to the ComboBox principle?
Prehistory : the application processes data from several almost identical tables, for this purpose a single basic show / process window is created, which uses a DataGrid with automatic creation of columns. In the markup (xaml), only a few trifles for the appearance and a pair of background and font color converters are defined. There are several buttons on the main application window that open the processing window, overriding the data source. Everything suited everyone - when clicking on a cell, it went into edit mode, then the completion event was caught, and so on.
Now, for one table, it was necessary to select data from a static list in one field (the use of ComboBox suggests itself), but I don’t want to abandon the autogeneration of columns - I don’t use markup, I want it programmatically. Therefore, from the base class of the processing window, I inherit a new class (it will be a new window), catch myGrid_AutoGeneratingColumn and in it I want to remake the desired column (recognize by name) in DataGridComboBoxColumn, so that when editing it is opened with a list.
Under the “hand” only the column we are looking for can change its properties, but it’s impossible to override its presentation style. Blackout Or am I trying in the wrong place?
MCVE? It is not entirely clear what exactly the problem is, since the method that you describe sounds logical. - user227049