简体   繁体   中英

Winforms C# VerticalScroll Bar on DataGridview not displayed

My windows form application,I have a gridview on my application and displays all the data required.

Problem is the vertical scrollbar is not visible, but when you scroll your mouse up and down it works.

Any specific property that I need to check?

Please note the scrollbar property's value is already set to BOTH screenshot below:

财产

the gridview columns are also set / defined manually and not auto generated, autogeneratecolumn is false

this is my application screenshot below:

应用

Update, the solution to my problem is remove the filling of gridview on Background Worker.

Since I was using background worker for this operation, tried removing it and the scrollbars also displayed.

Another thing that I found out when you have background color on column headers by default the scrollbars will not show if datagridview.EnableHeadersVisualStyles = false.

The Work around that I tried and actually works is to set these properties to true:

dataGridView1.Controls 1 .Enabled = true; // Index one is the vertical scrollbar dataGridView1.Controls 1 .Visible = true; // Index one is the vertical scrollbar

解决方案

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM