I have to make the datagrid to show only like 10 rows maximum. It is connected to a datasource (dataset) which may have a higher number of rows. If it has more rows, only show the first 10.
How can i make the datagridview to show only 10 rows ( and no scroll bar if it has more than 10 rows )
Thanks
GoDaddy Friday, April 25, 2008 11:36 AM
You can copy the first 10 rows from DataSet into another datatable and then bind the datatable to DataGridView.
Regarding scroll bar, you can set property of DataGridView.ScrollBars = ScrollBars.None if you wish to hide them.
Asif Shaikh Friday, April 25, 2008 11:55 AM
You can copy the first 10 rows from DataSet into another datatable and then bind the datatable to DataGridView.
Regarding scroll bar, you can set property of DataGridView.ScrollBars = ScrollBars.None if you wish to hide them.
Asif Shaikh Friday, April 25, 2008 11:55 AM
Thanks, but I already thought of that and was looking for a way that is more like a property of the datagridview that can be set.
GoDaddy Friday, April 25, 2008 12:22 PM
Sounds like you want to try and use DataGridView.VirtualMode. Check out the MSDN documents on it, I've never tried it myself.