Datagrid Scrollbars

S

scorpion53061

I have a datagrid that is switches between 2 different datasources.

I set the anchor properties of my datagrid to for bottom, top, left , right.

My form is set ot maximize on open.

If the user resizes the form, the scrollbars that should be visible on the
datagrid are not.

Occasionally the scrollbars disappear when the form is maximized when
switching between 2 differnet datasources but not always.

Any thoughts?

DataGrid2.TableStyles.Clear()
DataGrid2.SuspendLayout()

'fill dataset activities

DataGrid2.DataSource = dv1

DataGrid2.ResumeLayout()
DataGrid2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or
System.Windows.Forms.AnchorStyles.Left) _
Or
System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
DataGrid2.Update()
 
O

One Handed Man [ OHM# ]

have you tried invalidating the DataGrid on form.resize.

BTW, If I were you I would look for a beter DataGrid than the one supplied
with VS, with what your trying to do with it, it could save you a lot of
time. On the other hand, you get to become the Datagrid expert and can
answer all DG problems in this group and others.

OHM
I have a datagrid that is switches between 2 different datasources.

I set the anchor properties of my datagrid to for bottom, top, left ,
right.

My form is set ot maximize on open.

If the user resizes the form, the scrollbars that should be visible
on the datagrid are not.

Occasionally the scrollbars disappear when the form is maximized when
switching between 2 differnet datasources but not always.

Any thoughts?

DataGrid2.TableStyles.Clear()
DataGrid2.SuspendLayout()

'fill dataset activities

DataGrid2.DataSource = dv1

DataGrid2.ResumeLayout()
DataGrid2.Anchor =
CType(((System.Windows.Forms.AnchorStyles.Top Or

System.Windows.Forms.AnchorStyles.Left) _ Or
System.Windows.Forms.AnchorStyles.Right),
System.Windows.Forms.AnchorStyles) DataGrid2.Update()

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
S

scorpion53061

LOL

Datagrids will be the death of me.

I am getting ready to do just that (buy a grid).

I am cheating for now till another solution is apparent by taking away the
resize ability from the user. :(
 
K

Ken Tucker [MVP]

Hi,

I had to resize the datagrid manually to get the scrollbars to show
in a project I am working on. I made the datagrid 1 pixel smaller then
brought it back to the orginal size.

Ken
 
S

scorpion53061

Hi Ken,

Thanks for the tip worked great.


Ken Tucker said:
Hi,

I had to resize the datagrid manually to get the scrollbars to show
in a project I am working on. I made the datagrid 1 pixel smaller then
brought it back to the orginal size.

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top