Link to home
Start Free TrialLog in
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
Avatar of MajorBigDeal
MajorBigDeal
Flag of United States of America image

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?
Avatar of rwheeler23

ASKER

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
Avatar of MajorBigDeal
MajorBigDeal
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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".
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.
Thanks