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...

do you enabled Scrollbars for the grid?

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

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

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...

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

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.