Results 1 to 6 of 6

Thread: [RESOLVED] Problem adding rows to datagridview

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2012
    Location
    Caracas, Venezuela
    Posts
    121

    Resolved [RESOLVED] Problem adding rows to datagridview

    Hello everybody,

    Nedding some help.

    I programatically add rows to a datagridvew (dgv) with rows.add property.

    The problem is that, despite the rows count returns the right number, it seems that a an extra row is added, that makes vertical scrollbar to be shown before than expected because, apparently, the dgv height is larger than the sum of rows height plus the column header height.

    That happens with rows.add and rows.insert properties.

    Just do not know how to handle this.

    Thank you all.

    Nelson

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Problem adding rows to datagridview

    Have you set AllowUserToAddRows to False?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2012
    Location
    Caracas, Venezuela
    Posts
    121

    Re: Problem adding rows to datagridview

    Quote Originally Posted by jmcilhinney View Post
    Have you set AllowUserToAddRows to False?
    Hello jmcilhinney,

    Thanks for the response.

    Yes, AllowUserToAddRows is set to False.

    Thanks,

    Nelson

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2012
    Location
    Caracas, Venezuela
    Posts
    121

    Re: Problem adding rows to datagridview

    jmcilhinney,

    I have to say that it SEEMS it is a row, but it is not. If, in design time, you move down the DGV bottom a bit, you wll see that there is a space with a backcolor. If you keep moving the botton down a little bit more, the backcolor changes, non of those colors is rows backcolor.

    I do not know if the previous paragraph is clear enough.

    Thank you,

    Nelson

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Problem adding rows to datagridview

    I'm not in a position to test right now but could it be space reserved for the horizontal scroll bar if it's needed?

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2012
    Location
    Caracas, Venezuela
    Posts
    121

    Re: Problem adding rows to datagridview

    jmcilhinney,

    It's ok. I handled the issue by hiding and showing the vertical scrollbar as nedded and, accordingly, ajusting dgv.width

    Thanks again.

    Nelson

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