Results 1 to 7 of 7

Thread: Allow user to resize columns of DataGridView

  1. #1

    Thread Starter
    Addicted Member rkeslar's Avatar
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    145

    Question Allow user to resize columns of DataGridView

    I'm trying to allow users to resize columns of my datagridview, but it's not working.

    I have this line

    Code:
    DataGridView1.AllowUserToResizeColumns = True

    I want users to be able to resize columns the same way they would if in excel. Has anyone had any luck with this?

    Thanks

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Allow user to resize columns of DataGridView

    It should work. Does the Grid is Enabled ?
    Please mark you thread resolved using the Thread Tools as shown

  3. #3

    Thread Starter
    Addicted Member rkeslar's Avatar
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    145

    Re: Allow user to resize columns of DataGridView

    Quote Originally Posted by danasegarane View Post
    It should work. Does the Grid is Enabled ?
    Yeah it's enabled. I can rearrange the columns, but I can't resize them for some reason.

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: Allow user to resize columns of DataGridView

    I checked . It is working ...
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Allow user to resize columns of DataGridView

    Is the DataGridView databound?

  6. #6

    Thread Starter
    Addicted Member rkeslar's Avatar
    Join Date
    Jul 2009
    Location
    Pittsburgh, PA
    Posts
    145

    Re: Allow user to resize columns of DataGridView

    Quote Originally Posted by ForumAccount View Post
    Is the DataGridView databound?

    By DataBound, do you mean is it populated from a database? My DataGridview is populated from a flat file.

  7. #7
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Allow user to resize columns of DataGridView

    Quote Originally Posted by rkeslar View Post
    By DataBound, do you mean is it populated from a database? My DataGridview is populated from a flat file.
    I mean do you set the DataSource, or add any DataBindings? Also, what is the DataGridView's AutoSizeColumnsMode set to?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width