When setting this property, the DataGrid is already making DisplayIndex adjustments. For example, this exception is thrown when you attempt to set DisplayIndex in a DataGrid.ColumnDisplayIndexChanged event handler.
When setting this property, the specified value would result in a frozen column being displayed in the range of unfrozen columns, or an unfrozen column being displayed in the range of frozen columns.
The DisplayIndex property value must always correspond to one of the index values of the Items in the DataGrid.Columns collection for a column in the same DataGrid. The display index is automatically adjusted when columns are inserted or removed from the Columns collection.