Why can't I reach data within Method?

后端 未结 2 1682
轮回少年
轮回少年 2021-01-16 00:06

I\'m currently trying to fill a TableLayoutPanel through a method which goes as follows:

private int _rowCount;
public void InitPaths()
{
    in         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-16 00:39

    You are ittering through GetRowHeights(), returning the height of each row. But you are deleting from the RowStyles collection which is not directly related to the first collection. I assume that GetRowHeights() returns much more rows, than RowStyles has.

    Why not:

    BibTable.RowCount = 0;
    BibTable.RowStyles.Clear();
    

提交回复
热议问题