none
DataGridView Fill

    Question

  • Hi,

    I am developing in c# Visual Studio 2008.

    I have added to my project DataGridView and set the property "Dock" to Fill (I want the datagridview to Fill the panel that holds it).

    When I run the application, my DataGridView fills only as the maximum width of the columns, and then I get a lot of gray ugly area. I want the DataGridView to fill all the gray area, even if I have 2 columns. I don't mind if the columns will be very wide.

    Thank you.

    Tuesday, August 03, 2010 2:31 PM

Answers

  • Hello Spivakov83,

    Thanks for your post.

    Click dataGridView1 control, in the properties, set its AutoSizeColumnsMode as Fill. Then the dataGridView1's column width will change along with the form size. Please have a try. Is it helpful?

    If you have any problems, please feel free to follow up.

    Best regards,
    Liliane
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Thanks
    • Marked as answer by Liliane Teng Thursday, August 19, 2010 9:01 AM
    Thursday, August 05, 2010 7:54 AM
  • Hello Spivakov83,

    What about your problem? If you still need help, please feel free to follow up.

    Best regards,
    Liliane
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Thanks
    • Marked as answer by Spivakov83 Tuesday, September 14, 2010 3:33 PM
    Monday, August 16, 2010 10:21 AM

All replies

  • Hello Spivakov83,

    Thanks for your post.

    Click dataGridView1 control, in the properties, set its AutoSizeColumnsMode as Fill. Then the dataGridView1's column width will change along with the form size. Please have a try. Is it helpful?

    If you have any problems, please feel free to follow up.

    Best regards,
    Liliane
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Thanks
    • Marked as answer by Liliane Teng Thursday, August 19, 2010 9:01 AM
    Thursday, August 05, 2010 7:54 AM
  • Hello Spivakov83,

    What about your problem? If you still need help, please feel free to follow up.

    Best regards,
    Liliane
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Thanks
    • Marked as answer by Spivakov83 Tuesday, September 14, 2010 3:33 PM
    Monday, August 16, 2010 10:21 AM
  • Worked. Thanks
    Tuesday, September 14, 2010 3:34 PM