PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Datagrid horizontal scrollbar not appearing

Reply

Datagrid horizontal scrollbar not appearing

 
Thread Tools Rate Thread
Old 03-06-2005, 03:15 PM   #1
Brian Smith
Guest
 
Posts: n/a
Default Datagrid horizontal scrollbar not appearing


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
  Reply With Quote
Old 09-06-2005, 12:05 PM   #2
Brian Smith
Guest
 
Posts: n/a
Default Re: Datagrid horizontal scrollbar not appearing

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

Brian Smith wrote:
> 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

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off