问题
I have gridview with few hundreds rows, how can I force the gridview to extend it's hight and display all rows without scroolbar?
C# 3.0 / .net 3.5 /
回答1:
The DataGridView has several things which could help you to calculate the height:
- DisplayedColumnCount
- DisplayedRowCount - in relation to Rows.Count
- Rows -> GetRowsHeight()
- ColumnHeadersHeight
- RowTemplate - Height
But i would be really interested on which display resolution you display a few hundred rows without scrolling.
Last but not least (nor tested): Take a look into the properties AutoSize and AutoSizeMode
回答2:
You want display all the handreds rows without scrrolbar. you must change the height of the GridView when you load data.
DataGridView.Height= xxx Load data
来源:https://stackoverflow.com/questions/3263562/how-to-display-all-rows-in-grdiview-without-displaying-scrollbar