Fixed Row in DataGridView

Is it possible to fixed more than one row in DataGridView in C# windows form (similar to Delphi's TStringGrid component) ?

Lets say I wanted the first two rows to freeze, then row number 2 should behave like row number 1, its color and style should be similar to row number 1 as well. Also, when I scroll vertically, row number 2 again will like row number 1 will always be visible.

michellechan57Asked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
Very good, grasshopper ;)

Frozen cells don't appear to gain any different style, so you would have to apply your own style to either the column or the row.

Bob
0
 
Bob LearnedCommented:
I haven't found a way, yet.

Bob
0
 
michellechan57Author Commented:
Hi Bob,
Below statement can freeze the column or row but the style did not changed.
I supposed have to explicitly set the style

dataGridView1.Columns[0].Frozen = true;
dataGridView1.Rows[1].Frozen = true;
0
All Courses

From novice to tech pro — start learning today.