-
Oct 16th, 2017, 10:25 PM
#1
Thread Starter
Lively Member
[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
-
Oct 16th, 2017, 10:32 PM
#2
Re: Problem adding rows to datagridview
Have you set AllowUserToAddRows to False?
-
Oct 17th, 2017, 07:11 AM
#3
Thread Starter
Lively Member
Re: Problem adding rows to datagridview
Originally Posted by jmcilhinney
Have you set AllowUserToAddRows to False?
Hello jmcilhinney,
Thanks for the response.
Yes, AllowUserToAddRows is set to False.
Thanks,
Nelson
-
Oct 17th, 2017, 07:25 AM
#4
Thread Starter
Lively Member
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
-
Oct 17th, 2017, 08:46 AM
#5
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?
-
Oct 17th, 2017, 12:13 PM
#6
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|