Datagrid horizontal scrollbar not appearing

B

Brian Smith

I have a fixed size windows Form with a DataGrid docked to the top of
the form. The program allows a user to select from a list of columns to
be visible in the DataGrid - so I create a new TableStyle and
GridColumnStyles to match at runtime.

This works perfectly except that if the column widths exceed the size of
the DataGrid no HScrollbar appears. I've seen comments about needing to
derive from dataGrid to access the protected scrollbar properties but
surely the basic grid should do this - is it a bug, and is there a
workaround other than deriving a new control???

brian smith
 
B

Brian Smith

OK, fixed it myself. Problem relates to general issues with using
inherited forms. The grid was set to Dock=Fill on the base form, but
somehow this meant that the height of the grid on the derived form was
actually larger than its container (a tabpage), so the hscrollbars could
not be seen. Reverted to undocked mode, setting grid size in form_load.

brian smith
 

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