Open
Description
I was looking for a good way to exclude a DataColumn
when the DataGridView
is autogenerating its DataGridViewColumn
s. I somehow stumbled upon a way to do it: just setting the DataColumn.ColumnMapping = MappingType.Hidden
does exactly what I wanted.
I think this should be mentioned at least on the How to: Remove Autogenerated Columns from a Windows Forms DataGridView Control, better yet also in the How to: Autogenerate Columns in a Data-Bound Windows Forms DataGridView Control, and even better throughout the DataGridView
docs.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 398e57ba-ac96-13a4-a4b1-5010d1b7128e
- Version Independent ID: e27e06d1-ec67-85ee-b18b-0e4b9d731b16
- Content: Remove Autogenerated Columns from DataGridView Control - Windows Forms .NET Framework
- Content Source: dotnet-desktop-guide/framework/winforms/controls/remove-autogenerated-columns-from-a-wf-datagridview-control.md
- Product: dotnet-framework
- Technology: dotnet-winforms
- GitHub Login: @adegeo
- Microsoft Alias: adegeo