954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

unbound datagidview refresh problem

i have a problem with refreshing a datagridview.

so i have an unbound datagridview that is not enabled.

rows are added when a button is clicked.

this works the first time, but when i click the button again, the new rows are not all displayed, only the rows that fit the size of the datagridview are shown, but when i resize my form, that's when all the rows are displayed. i think this may be a repaint problem but i don't know the proper code to solve this.

i can enable the datagridview before i add the rows, but i'd like to know if there's another way.

thank you...

zepi
Newbie Poster
7 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

do you enabled Scrollbars for the grid?

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 

hi, yes the scrollbars are enabled. but the the whole datagridview is not during the adding of new rows.

zepi
Newbie Poster
7 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

In design its showing the complete grid in the form?.
in runtime ru setting any width and height property of grid?

Pgmer
Master Poster
714 posts since Apr 2008
Reputation Points: 54
Solved Threads: 121
 
In design its showing the complete grid in the form?.

yes.in runtime ru setting any width and height property of grid?

no.

i did not change any property of the grid except for the enable property...

zepi
Newbie Poster
7 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

did you use a .SuspendLayout() and in the same scope a .ResumeLayout() ?

Marcel_Go
Newbie Poster
11 posts since Feb 2011
Reputation Points: 18
Solved Threads: 3
 

hmmm, no i did not. i just used the

datargidview.enabled = false


then i added rows...then

datagridview.enabled = true


was i supposed to use suspend and resumelayout?

i'll try those later...

zepi
Newbie Poster
7 posts since Feb 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: