Datagrid Scrollbars

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • scorpion53061

    Datagrid Scrollbars

    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.Table Styles.Clear()
    DataGrid2.Suspe ndLayout()

    'fill dataset activities

    DataGrid2.DataS ource = dv1

    DataGrid2.Resum eLayout()
    DataGrid2.Ancho r = CType(((System. Windows.Forms.A nchorStyles.Top Or
    System.Windows. Forms.AnchorSty les.Left) _
    Or
    System.Windows. Forms.AnchorSty les.Right), System.Windows. Forms.AnchorSty les)
    DataGrid2.Updat e()


  • One Handed Man [ OHM# ]

    #2
    Re: Datagrid Scrollbars

    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

    scorpion53061 wrote:[color=blue]
    > 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.Table Styles.Clear()
    > DataGrid2.Suspe ndLayout()
    >
    > 'fill dataset activities
    >
    > DataGrid2.DataS ource = dv1
    >
    > DataGrid2.Resum eLayout()
    > DataGrid2.Ancho r =
    > CType(((System. Windows.Forms.A nchorStyles.Top Or
    >
    > System.Windows. Forms.AnchorSty les.Left) _ Or
    > System.Windows. Forms.AnchorSty les.Right),
    > System.Windows. Forms.AnchorSty les) DataGrid2.Updat e()[/color]

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


    Comment

    • scorpion53061

      #3
      Re: Datagrid Scrollbars

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

      "One Handed Man [ OHM# ]" <OneHandedMan{a t}BTInternet{do t}com> wrote in
      message news:eKlbt1jxDH A.2116@TK2MSFTN GP11.phx.gbl...[color=blue]
      > 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
      >
      > scorpion53061 wrote:[color=green]
      > > 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.Table Styles.Clear()
      > > DataGrid2.Suspe ndLayout()
      > >
      > > 'fill dataset activities
      > >
      > > DataGrid2.DataS ource = dv1
      > >
      > > DataGrid2.Resum eLayout()
      > > DataGrid2.Ancho r =
      > > CType(((System. Windows.Forms.A nchorStyles.Top Or
      > >
      > > System.Windows. Forms.AnchorSty les.Left) _ Or
      > > System.Windows. Forms.AnchorSty les.Right),
      > > System.Windows. Forms.AnchorSty les) DataGrid2.Updat e()[/color]
      >
      > Regards - OHM# OneHandedMan{at }BTInternet{dot }com
      >
      >[/color]


      Comment

      • Ken Tucker [MVP]

        #4
        Re: Datagrid Scrollbars

        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
        ------------
        "scorpion53 061" <scorpion_53061 nospamherepleas e@yahoo.com> wrote in message
        news:O$P$eyixDH A.3140@TK2MSFTN GP11.phx.gbl...[color=blue]
        >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.Table Styles.Clear()
        > DataGrid2.Suspe ndLayout()
        >
        > 'fill dataset activities
        >
        > DataGrid2.DataS ource = dv1
        >
        > DataGrid2.Resum eLayout()
        > DataGrid2.Ancho r = CType(((System. Windows.Forms.A nchorStyles.Top Or
        > System.Windows. Forms.AnchorSty les.Left) _
        > Or
        > System.Windows. Forms.AnchorSty les.Right),
        > System.Windows. Forms.AnchorSty les)
        > DataGrid2.Updat e()
        >
        >[/color]


        Comment

        • scorpion53061

          #5
          Re: Datagrid Scrollbars

          Hi Ken,

          Thanks for the tip worked great.


          "Ken Tucker [MVP]" <vb2ae@bellsout h.net> wrote in message
          news:%23HHv0xnx DHA.536@tk2msft ngp13.phx.gbl.. .[color=blue]
          > Hi,
          >
          > I had to resize the datagrid manually to get the scrollbars to[/color]
          show[color=blue]
          > in a project I am working on. I made the datagrid 1 pixel smaller then
          > brought it back to the orginal size.
          >
          > Ken
          > ------------
          > "scorpion53 061" <scorpion_53061 nospamherepleas e@yahoo.com> wrote in[/color]
          message[color=blue]
          > news:O$P$eyixDH A.3140@TK2MSFTN GP11.phx.gbl...[color=green]
          > >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[/color][/color]
          the[color=blue][color=green]
          > > datagrid are not.
          > >
          > > Occasionally the scrollbars disappear when the form is maximized when
          > > switching between 2 differnet datasources but not always.
          > >
          > > Any thoughts?
          > >
          > > DataGrid2.Table Styles.Clear()
          > > DataGrid2.Suspe ndLayout()
          > >
          > > 'fill dataset activities
          > >
          > > DataGrid2.DataS ource = dv1
          > >
          > > DataGrid2.Resum eLayout()
          > > DataGrid2.Ancho r = CType(((System. Windows.Forms.A nchorStyles.Top[/color][/color]
          Or[color=blue][color=green]
          > > System.Windows. Forms.AnchorSty les.Left) _
          > > Or
          > > System.Windows. Forms.AnchorSty les.Right),
          > > System.Windows. Forms.AnchorSty les)
          > > DataGrid2.Updat e()
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...