Avatar of rwheeler23
rwheeler23Flag for United States of America asked on

C# Datagrid fill all rows

I have a display screen that presents a datagrid view. There is room for about 12 rows in the grid. Can anyone point me to examples of how to fill the blank rows so the datagrid completely fills the display area? Right now it only displays the rows that are returned in the query and the remainder are left blank.  I have attached the code that displays the grid.
DataGridFillRows.tif
Code.txt
C#

Avatar of undefined
Last Comment
rwheeler23

8/22/2022 - Mon
MajorBigDeal

Just to clarify the question, are you saying that you want the two rows returned by the query to each take up about half the screen?  In other words, you want to height of the rows to autoscale to fill up the available space on the screen?  Or are you asking something else?
ASKER
rwheeler23

My mistake, since there is room for 12 rows, I want to see the two rows with data plus 10 blank rows. So there always will be 12 rows. It is only a matter of how many will be blank and how many will have data.
ASKER CERTIFIED SOLUTION
MajorBigDeal

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
rwheeler23

If I do that, I will I be able to commit changes back to the database? I just want the input screen to like nice and properly filled in and then commit whatever changes are made.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
MajorBigDeal

You are right that it will make things much more difficult then just using the default  binding.   The thing is that there is nothing wrong with your screen shot.  It looks good, it looks normal, it looks the way it is supposed to look.  So if you go to all the trouble and extra logic to add extra blank rows, it is going to look worse.  People are going to think there is a bug in the application.  It will look like there are 10 rows of data that are "missing".
ASKER
rwheeler23

Understood. I am trying to match the screens to the ERP solution they use and they fill all the rows. Of course, that solution is written in a much more robust language. Thanks for your tips.
ASKER
rwheeler23

Thanks
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.