Why can't I reach data within Method?

后端 未结 2 1224
逝去的感伤
逝去的感伤 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:43

    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();
    
    0 讨论(0)
  • 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();
    
    0 讨论(0)
提交回复
热议问题