For a C# 2005DataGridView, I need to keep a particular row of data fixed at position 0. It doesn't matter to meif it scrolls out of the display area if the user scrolls down, or if it stays "frozen" at the top of the grid.
It seems the best way to do this is to use the Row.Frozen property.
Therefore, if I set Rows[0].Frozen = true, the first row in the DataGridView is frozen, which is what I want. However, if the user presses the sort header and resorts the grid, the previously frozen row is sorted to someplace else, and a different row becomes frozen. Also, if they enter data into the row, it is sorted to another location. How can I keep the same exact row frozen in position [0] regardless of the sort? I do not want to disable sorting, as that is needed for all rows except Row[0].
Since my Grid is bound to a DataTable as the datasource, I could modify the data by adding a hidden column and forcing the particular row to always be sorted to index 0, but I do not want to modify the data source or add any additional columns.
For example, is there someway to override the default sort method to ignore a row?, etc. Custom sorting seems to be not allowed when bound to a datasource.