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
LVL 1
rwheeler23Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MajorBigDealCommented:
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?
0
rwheeler23Author Commented:
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.
0
MajorBigDealCommented:
In that case I think I would use a DataTable as the data source, and populate it the way you want.   You can build rows in the DataTable using the results of your query and then pad it out using something like: aDataTable.Rows.Add(new object[] {string.Empty, string.Empty});
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

rwheeler23Author Commented:
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.
0
MajorBigDealCommented:
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".
0
rwheeler23Author Commented:
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.
0
rwheeler23Author Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.