Control Datagrid height in vs2003

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

    Control Datagrid height in vs2003

    hi all,

    my problem is...i have 2 textbox for user input no. of row and no.of
    column. After user input, the datagrid will show what user input....for
    example: user input 5 rows and 6 column. After that...the datagrid will
    show.I would like to control the height for datagrid after generate... but i
    only can control the width....any one have idea about this.

    Thanks


  • Charlie Brown

    #2
    Re: Control Datagrid height in vs2003

    On Apr 11, 9:45 pm, "Localbar" <localbar...@gm ail.comwrote:
    hi all,
    >
    my problem is...i have 2 textbox for user input no. of row and no.of
    column. After user input, the datagrid will show what user input....for
    example: user input 5 rows and 6 column. After that...the datagrid will
    show.I would like to control the height for datagrid after generate... but i
    only can control the width....any one have idea about this.
    >
    Thanks
    Check out Datagrid Girl's website, she always has something good to
    say...




    Comment

    • Localbar

      #3
      Re: Control Datagrid height in vs2003

      thx first....actual ly my program is vb.net....not asp.net
      um...difficult to do

      "Charlie Brown" <cbrown@duclaw. com???
      news:1176346972 .845277.151950@ n76g2000hsh.goo glegroups.com ???...
      On Apr 11, 9:45 pm, "Localbar" <localbar...@gm ail.comwrote:
      hi all,

      my problem is...i have 2 textbox for user input no. of row and no.of
      column. After user input, the datagrid will show what user input....for
      example: user input 5 rows and 6 column. After that...the datagrid will
      show.I would like to control the height for datagrid after generate...
      but i
      only can control the width....any one have idea about this.

      Thanks
      >
      Check out Datagrid Girl's website, she always has something good to
      say...
      >

      >
      >

      Comment

      • Charlie Brown

        #4
        Re: Control Datagrid height in vs2003

        My apologies, I was a little to quick to answer.

        In both .net 1.1 and 2.0 for windows forms, the datagrid and
        datagridview, respectively both support the Height property inherited
        from the Control class.

        If you can't get it work that way, your best bet is place a panel
        control on your form, then place your datagrid inside there with the
        datagrids dockstyle set to fill. Then you can reesize the panel to
        whatever you need, and the grid will follow suit.

        Comment

        • Localbar

          #5
          Re: Control Datagrid height in vs2003

          Thansks...
          Actually ...I mean is row height....sorry I didn't write clearly
          if user would like 5 row and 4 cloumn....after click generate button..
          the grid will come out also each cell have same height and width ( for
          example : may be each cell height = 100 width = 200)

          "Charlie Brown" <cbrown@duclaw. com???
          news:1176355779 .768634.311640@ y80g2000hsf.goo glegroups.com ???...
          My apologies, I was a little to quick to answer.
          >
          In both .net 1.1 and 2.0 for windows forms, the datagrid and
          datagridview, respectively both support the Height property inherited
          from the Control class.
          >
          If you can't get it work that way, your best bet is place a panelI didn't
          control on your form, then place your datagrid inside there with the
          datagrids dockstyle set to fill. Then you can reesize the panel to
          whatever you need, and the grid will follow suit.
          >

          Comment

          • ClayB

            #6
            Re: Control Datagrid height in vs2003

            Programmaticall y setting rowheights in a Windows Forms DataGrid is not
            simple as the proper methods and fields are not publicly exposed in
            the DataGrid. Here is a FAQ entry that steps you through using
            reflection to get at these necessary class members.

            Build faster with enterprise-ready, AI-powered UI components including blazing fast grids, charts, schedulers, and editors. Get PDF, Word, and Excel document SDKs for Blazor, React, Angular, JavaScript, and .NET MAUI.


            =============== ===========
            Clay Burch
            Syncfusion, Inc.

            Comment

            • ClayB

              #7
              Re: Control Datagrid height in vs2003

              You can set all the rowheights to be the same fixed value by setting

              DataGrid1.Prefe rredRowHeight = xxxx

              The previous comment regarding using reflection to set row heights is
              only applicable if you need to make the rowheights vary from row to
              row programmaticall y.
              =============== =====

              Clay Burch
              Syncfusion, Inc.

              Comment

              • Localbar

                #8
                Re: Control Datagrid height in vs2003

                Clay
                Thanks so much....


                "ClayB" <clayb@syncfusi on.com???
                news:1176368666 .326127.201450@ p77g2000hsh.goo glegroups.com ???...
                You can set all the rowheights to be the same fixed value by setting
                >
                DataGrid1.Prefe rredRowHeight = xxxx
                >
                The previous comment regarding using reflection to set row heights is
                only applicable if you need to make the rowheights vary from row to
                row programmaticall y.
                =============== =====
                >
                Clay Burch
                Syncfusion, Inc.
                >

                Comment

                Working...