Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6200383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:21:26+00:00 2026-05-24T04:21:26+00:00

I drag and drop a Table view on my form application. I would like

  • 0

I drag and drop a Table view on my form application. I would like to know how can I programatically resize the table base based on the numbers of rows that i add. Appreciate if you can show mw some code.
thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:21:27+00:00Added an answer on May 24, 2026 at 4:21 am

    You can use the setFixedHeight method, the tricky part is how to calculate the correct height.

    There are a couple of things that will greatly affect the desired height – other than the number of rows.

    a) Whether or not the horizontalHeader is shown
    b) Whether the rows are uniform heights.

    Let’s assume it is visible, and that the rows are uniform heights. So then our desired height would be – the height of the header + a typically row* the number or rows, plus a couple of pictures for border spacing.

    MyTableView->horizontalHeader()->height() + _NumberOfRows * MyTableView->rowHeight(0) + 2
    

    Now, if the header is not visible – which we can check by calling horizontalHeader()->isVisible, then obviously we can leave off it’s height.

    If our rows are not uniform height, then we can’t just calculate it, we’ll have to loop through them all and get each of their heights individually.

    Then, as I said before, call setFixedHeight, and you’re good to go. Barring any weird styling or things like that, this should cover everything.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a good .Net component for drag/drop/resize drawing in 2D with connections (like
My application has a canvas and a table, I need to add drag-and-drop capabilities
**I need to implement Drag and Drop in my table view.I have a table
In VisualStudio, when you drag and drop a table or an individual column from
ok i've got a table with drag and drop classes in a div that
Folks, I need a solution that allows drag-and-drop cell over the table. The cells
i make a class of elements draggable like this jQuery(.drag).draggable(); jQuery(.drop).droppable({ accept: .drag, drop:
I use VS2010 and then drag and drop Member datagridview to design view. After
I just implemented drag and drop sort table on my site Demo Link On
I know there are number of threads available on stackoverflow regarding drag & drop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.