Reputation: 51224
Is it possible to make DataGridView
column headers scroll out of view along with other rows when the grid is scrolled down? I.e. not to keep them visible at all times?
Is there a property in DataGridView
which would allow this?
Upvotes: 1
Views: 776
Reputation: 66449
I don't know of any design-time property you could set, but maybe you could do something like this? (Not tested, not sure how well it will perform.)
private void dataGridView1_Scroll(object sender, ScrollEventArgs e)
{
if (e.ScrollOrientation == ScrollOrientation.VerticalScroll)
dataGridView1.ColumnHeadersVisible = (e.NewValue == 0);
}
Upvotes: 1