Windows Develop Bookmark and Share   
 index > Windows Forms Designer > DataGridView Height
 

DataGridView Height

Hi i have created a Usercontrol with a DataPicker and DataGridView. The DatePicker is the top and DataGridView is the bottom element.
Wht i have to do , i am also setting Gridview Row heigh dynamically. I want to resize the grid with number of rows. means i wan to set the height of the girdView.

How cn i do this.

Progress2007  Tuesday, June 30, 2009 2:22 PM
Hi,

You can handle the RowsAdded event of the DataGridView. In the event handler, loop through the rows in the DataGridView to add the height of each row up and then set the height of the DataGridView based on the sum height of all rows in it.

Hope this helps.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com.
Linda Liu  Tuesday, July 07, 2009 10:15 AM
Thanks Lindia, Lu for ur help..
Progress2007  Tuesday, July 07, 2009 10:44 AM
Please Change topic type to Question and mark Linda's reply as answer.



Thanks

- Omie
Someone makes my heart skip a clock cycle !
Omie  Tuesday, July 07, 2009 11:34 AM

You can use google to search for other answers

Custom Search

More Threads

• WYSIWYG HTML Editor Control
• Why TreeView multiplying itself when searching !!!!
• Creating Events in C#
• One or more errors encountered while loading the designer
• How to Access a project from another project
• designhost sample - toolbox with controls of the same type
• AutoScrolling
• How to disable serializing a property on a derived control?
• textbox visible property
• OnPaint method Issue