Windows Develop Bookmark and Share   
 index > Windows Forms General > DataGridView Max row
 

DataGridView Max row

Hi,

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.
wjousts  Friday, April 25, 2008 1:28 PM

You can use google to search for other answers

Custom Search

More Threads

• Trying to learn more regarding interface based development
• Removing selected row from listView
• Snapping moveable Controls
• Messagebox.show() show help problem
• How to make a help file?
• BackgroundWorker problem
• creating a color display matrix
• String format+Middle center
• Implement List<MyObject>.Sort()
• it is possible to uncheck all items in a checkedlistbox whit one statment??