mono/mono — pull request #479 by Shabbafru (2012-10-16 14:05:53+00:00)
Title: DataGridView: Auto resizing of the witdh of row headers fails when no rows are displayed

The `DataGridView` has a method `AutoResizeRowHeadersWidth` that resizes the header cells of the rows based on their preferred size. If the sizing mode is `DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders`, only the row header cells that are displayed are taken into account for calculating the `new_width`. This can lead to a problem if no rows are displayed as `new_width` is then 0 and setting the `RowsHeadersWidth` property with a value less than 4 results in an exception.