{"record":{"id":"c3293d6a19e5a532","repo":"dotnet/wpf","slug":"sr-datagridcolumnheaderitemautomationpeer-unsupported","errorCode":null,"errorMessage":"SR.DataGridColumnHeaderItemAutomationPeer_Unsupported","messagePattern":"SR\\.DataGridColumnHeaderItemAutomationPeer_Unsupported","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"warning","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DataGridColumnHeaderItemAutomationPeer.cs","lineNumber":166,"sourceCode":"            get \n            { \n                if (this.Column != null)\n                    return Column.CanUserResize;\n                return false;\n            } \n        }\n\n        bool ITransformProvider.CanRotate \n        { \n            get \n            { \n                return false; \n            } \n        }\n\n        void ITransformProvider.Move(double x, double y)\n        {\n            throw new InvalidOperationException(SR.DataGridColumnHeaderItemAutomationPeer_Unsupported);\n        } \n\n        void ITransformProvider.Resize(double width, double height)\n        {\n            if (this.OwningDataGrid != null && Column.CanUserResize)\n            {\n                Column.Width = new DataGridLength(width);\n            }\n            else\n            {\n                throw new InvalidOperationException(SR.DataGridColumnHeaderItemAutomationPeer_Unresizable);\n            }\n        }\n\n        void ITransformProvider.Rotate(double degrees)\n        {\n            throw new InvalidOperationException(SR.DataGridColumnHeaderItemAutomationPeer_Unsupported);\n        }","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DataGridColumnHeaderItemAutomationPeer.cs#L148-L184","documentation":"DataGridColumnHeaderItemAutomationPeer's ITransformProvider.Move is never supported: column headers cannot be repositioned by an x/y offset (drag-reorder is not expressed as a transform), so Move unconditionally throws InvalidOperationException with SR.DataGridColumnHeaderItemAutomationPeer_Unsupported.","triggerScenarios":"Any automation client calling ITransformProvider.Move(x, y) on a DataGrid column header peer — there is no condition; the operation is always rejected.","commonSituations":"UIA transform-pattern scripts attempting to move/drag headers programmatically; accessibility tools exposing Transform pattern on headers; automation attempting column reorder via Move instead of the proper drag mechanism.","solutions":["Do not call Move on column headers; reorder columns via DataGrid.Columns collection manipulation instead.","Catch InvalidOperationException and treat Move as unsupported (check pattern support before calling).","If dragging is required, simulate input (mouse drag) rather than using ITransformProvider.","Verify supported operations with automation pattern capability checks."],"exampleFix":"// before\n((ITransformProvider)headerPeer).Move(100, 0);\n\n// after\ndataGrid.Columns.Move(oldIndex, newIndex); // reorder via the collection","handlingStrategy":"try-catch","validationCode":"// Move is never supported on column headers; do not call.","typeGuard":null,"tryCatchPattern":"try { ((ITransformProvider)peer).Move(x, y); } catch (InvalidOperationException) { /* unsupported: reorder via Columns collection */ }","preventionTips":["Never use Transform.Move for column reordering","Reorder via DataGrid.Columns.Move","Check pattern member support before invoking"],"tags":["wpf","automation","datagrid","transform","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}