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 7662533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:49:34+00:00 2026-05-31T13:49:34+00:00

I want to make my row to auto resize depending on screen size. When

  • 0

I want to make my row to auto resize depending on screen size.
When I do this for column it really works:

grid.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;

But when I want to do same thing for row. I don’t have fill option.
I only have like

grid.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;

How can I make my rows to fill my screen depending on it’s size?

  • 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-31T13:49:35+00:00Added an answer on May 31, 2026 at 1:49 pm

    You can use the AutoResizeRow method.

    Per MSDN:

    This method is useful if you want to control when a row resizes. The row height is adjusted only once per method call; if the contents of the row later change, the row will not automatically adjust. To resize all rows, use the AutoResizeRows method. To set the row to automatically resize whenever its contents change, use the AutoSizeRowsMode property.

    There’s also a MSDN sample here.

    You may want to look in to the RowTemplate property named Height. You can do your calculation as to when the screen size changes

    EDIT:

    You can put this in a resizing event, such as Form_ResizeEnd. YMMV on how the grid may perform with a large number of rows.

    foreach (DataGridViewRow row in dataGridView1.Rows)
    {
        row.Height = 22; //your calculation based on the screen height
    }
    

    I believe you can use System.Windows.Form.Screens class, specifically Screens.PrimaryScreen.Bounds.Height if you want the primary screen’s height. It’s up to you to see what kind of size you want to maintain.

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

Sidebar

Related Questions

say I want to make the first row of the excel ss something like
I want to make sure I'm not inserting a duplicate row into my table
I'm attempting to make an auto-indenting textarea and so far it works with the
I want to make a trigger to do this: UPDATE formulario SET ano =
How can I make a table auto size to content (e.g. use the minimum
I came across this problem in javabat( http://www.javabat.com/prob/p183562 ): We want to make a
I want make datetimepicker in my project. Using jquery how it is possible? I
Let's say I want make some of my sources publicly available via my blog
I have style sheet with a class name changebackgroundcolor i want make change in
I am traversing a HTML document using javascript DOM. I want make a list

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.