Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I am using data grid view for displaying the data. I am binding the data from data table to data grid view .. The data from the data grid view is displaying but while while dynamically binding the data,horizontal scroll bar is enabled but not working properly .That means " when moving Scroll bar from left to right, suddenly it returned to left side ". please suggest some ideas to rectify this issue.

Thanks in advance,

Dj
Posted

There are two potential options to fix this issue.

1. Frozen property
One of the columns may have frozen property set as True, which should be false for all columns.

2. AutoSize and Scrollbars property
You can try setting AutoSize and Scrollbars property explicitly.

Otherwise, ScrollBar should be working absolutely fine.
 
Share this answer
 
Comments
DevarajSubramaniam 9-Jul-12 7:50am    
i tried these things also.. but scroll bar remains unstable. it continuously returns to left side suddenly.

Thanks ,
Dj
Jawahar V 29-Jan-24 5:36am    
DJ, Add a Screenshot of that form
Try using:

dataGridView1.PerformLayout();



Rendering the DataGridViews is a costly operations, wherefore setting the layout is invoked manually, except for the initial display.

See here[^]

You should also Perform Layouting in your Resize Handler of your Form or Control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900