tags:

views:

104

answers:

2

I fill the DGV by looping through a dataset and adding a DGV row for each datarow. After this the DGV.RowCount = DataSet.Rows.Count. Funny thing is that the DGV shows only a part of it (19 of 2448 in my example). After some testing I figured out that the rows show up if I change the Window size a bit.

So now I use a work-around by including the following code after I've filled the DGV:

frmMain.Height = frmMain.Height + 1
frmHoofd.Height = frmHoofd.Height - 1

This works, but I'm wondering why.

A: 

I think this may be because of some default settings of DGV. From the description you given it looks like you are not using databinding. Have you tried it?

Andrew Bezzub
No, I'm not using databinding and prefer to not use it. I examined the properties of the DGV but cannot find anything that explains this behaviour.
+2  A: 

I agree in regards to the databinding. I feel restricted when utilizing Microsofts's databindings. I like to utilize unbound datasource's which expands my ability to manipulate the data. On to your question which sounds like you possibly have a docking issue. Is the datagridview displaying space below the displayed rows as in a blank space where rows should be? I would check your dock settings to ensure you have the datagridview docked.

The only setting I know of that limits the datagridview's ability to display rows is the DoubleBuffered property which can only be accessed via inheriting a datagridview as mentioned in an answer to my own question regarding a datagridview's DoubleBuffering property.

http://stackoverflow.com/questions/3637175/how-do-i-override-microsofts-datagridview-to-allow-back-buffering-in-vb-net

Michael Eakins