Why can't I reach data within Method?

后端 未结 2 1223
逝去的感伤
逝去的感伤 2021-01-16 00:29

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:53

    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();
    

提交回复
热议问题