Open osamakawish opened 4 years ago
I think our documentation is to blame for the confusion - the RowCount
property doesn't do what you think it does. It does not allocate or create any rows for you, it sets the maximum number of rows the panel will have.
@RussKie
It does not allocate or create any rows for you, it sets the maximum number of rows the panel will have.
There's more to the confusion than that. If the property was renamed MaxRows
or MaxRowCount
instead of RowCount
, it would also be less confusing.
We can't rename public API, this would be a massively breaking change.
If someone wants to clarify documentation here the help would be welcome.
This issue is now marked as "help wanted", and we’re looking for a community volunteer to work on this issue. If we receive no interest in 180 days, we will close the issue. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
.NET Core Version: 3.1.301
Have you experienced this same bug with .NET Framework?: Yes, this was made in .Net Framework 4.7.2 (according to project information).
Problem description: The following is my class. It's straightforward and just contains a table. The table is 6x6 in the Designer (for testing).
Table
here is aTableLayoutPanel
.Error:
It turns out, the error occurs when it tries to reach index 6 (which is basically the RowCount in the Designer).
I'm not sure why this is occurring, as I just set new values for the RowCount and ColumnCount a few lines before.
Expected behavior: Index should not be out of range for Table.RowStyles[i] when it's less than Table.RowCount.
Minimal repro: Not sure what "repro" means...