Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have few lines to tell
1. when you gave me the code i used it in a separate project it successfully run. everything was just fine as i wanted . but when used with arrays[array with large deta( with just 50 columns and 100 rows)] it collapsed. why. there were no scroll bars visible on the form .if scroll bars were visible i could drag them to the extreme to view all deta. i have used your full code as you mentioned the dgv exceeded the borders of the form
i have not changed any property except the anchor property was set to top,left,bottom,right

What I have tried:

i told everything in the detail section of the question .
Posted
Updated 19-Feb-21 6:54am
v2

In the design view of your main form, select the DataGridView, then in the Properties page set Anchor to Top, Left and Dock to Fill.
 
Share this answer
 
Comments
Member 12712527 19-Feb-21 4:17am    
sir you say using dock property is problematic
Richard MacCutchan 19-Feb-21 5:17am    
I cannot guess what that means. Please think about what you need to say, and provide full details.
RickZeeland 19-Feb-21 12:47pm    
That was my advice, I prefer not to use Dock as I had some problems with it in the past.
Richard MacCutchan 19-Feb-21 12:55pm    
I ran a test earlier and it seems to do what is necessary. But I have never tried a DGV with more than about 10 columns.
RickZeeland 19-Feb-21 13:04pm    
The problems I encountered were with a datagridview placed in a usercontrol. I also think Anchor is easier to use when you want other controls like e.g. Buttons aligned next or under the datagridview. But all this might be a personal preference of course :)
As we don't have access to your code and computer we can not help you sufficiently.
Try seeking out advice from someone in your neighbourhood or follow a course on the subject, e.g. one of these: Top Windows Forms Courses Online - Updated [February 2021] | Udemy[^]
 
Share this answer
 

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



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