Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I programmatically set the height of a row in a DataGrid?

DataGrid does not expose row height through a public member. However it is possible to set row heights using reflection to access the DataGrid internal row properties, based on a suggestion from Matthew Benedict.

Here is a sample project (C# and VB) showing how you might do this. The sample provides DataGridRowHeights class that you instantiate from a DataGrid. You then use this object's indexer to set and get the DataGrid row heights.

Contributed from George Shepherd's Windows Forms FAQ