2012-04-18 4 views
1

私は2つのボタンを持つ私のカスタムTableCellを使用するTableDataSourceを作っています。 B C DUITableViewはDataSourceより多くの要素を持っています

表ビューを表示します: B C D B C D B

 List<ConductedActivitiesItem> _items = new List<ConductedActivitiesItem>(); 
     foreach(var item in this._logicActivities.Steps) 
     { 
      _items.Add(new ConductedActivitiesItem(){ Date = "12-13", Text = item.Lines[0], Checked = null }); 
     } 

     var ds = new ConductedActivitiesDataSource(_items); 
     var dg = new CSTableViewDelegate(null); 

     dg.SelectionChanged += this.Steps_SelectionChanged; 

     this.Pad_tbvMeasures.DataSource = null; 

     this.Pad_tbvMeasures.DataSource = ds; 
     this.Pad_tbvMeasures.Delegate = dg; 
     this.Pad_tbvMeasures.ReloadData(); 

リスト4つのアイテムを持っています c d

リストに、データソースよりも多くのアイテムが表示される理由を知っている人はいますか?

+0

RowsInSection()はどのように行数を取得しますか? – Jason

+0

私のデータソースでは、アイテムのリストの数を返します - > this._list.Countを返します – Alex

+0

問題解決済み...ありがとうございました。私の同僚はまた、NumberOfSections()をオーバーライドし、_items.Countを返します。今私はこのメソッドを削除し、それが動作します。 – Alex

答えて

3

NumberOfSections()およびRowsInSetion()メソッドをチェックして、正しい値が返されていることを確認します。

+0

NumberOfSections()を削除して解決しました。 – Alex

関連する問題