2012-04-18 3 views
1

두 개의 Button이있는 사용자 정의 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

목록에 DataSource보다 많은 항목이 표시된 이유가 누구에게 있습니까?

+0

RowsInSection()은 행 수를 어떻게 계산합니까? – Jason

+0

내 데이터 소스에서 항목 수가있는 목록 수를 반환합니다. -> this._list.Count를 반환합니다. – Alex

+0

문제가 해결되었습니다. Jason이 도움을 많이주었습니다. 동료는 NumberOfSections()를 재정 의하여 _items.Count를 반환합니다. 이제이 방법을 제거하고 작동합니다. – Alex

답변

3

NumberOfSections() 및 RowsInSetion() 메서드가 올바른 값을 반환하는지 확인하십시오.

+0

NumberOfSections()를 제거하여 해결되었습니다. – Alex

관련 문제