DataGridView problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have a DataGridView object in a C# desktop app (.NET 2.0, by the way). I
am setting the DGV to use a SelectionMode of "ColumnHeaderSelect". I am
dynamically creating all of the columns and when I create them, I am setting
the SortMode to "Programmatically". However, when I debug my app and open
that form, I get the following error:

System.InvalidOperationException was unhandled
Message="Column's SortMode cannot be set to Automatic while the
DataGridView control's SelectionMode is set to ColumnHeaderSelect."

What gives? I have set it to a combination other than what the error
message indicates. Is this a bug with .NET 2.0? Am I missing something?

Tim


.