2011-04-01 76 views

回答

1

使用重複列的行數,這樣在數據列表:

RepeatColumns = "5" 
0

您可以使用[數列有限在這裏輸入鏈接描述] [Enumerable.Take]和「Take」你需要的行數。從MSDN

例子:

 int[] grades = { 59, 82, 70, 56, 92, 98, 85 }; 

     IEnumerable<int> topThreeGrades = 
      grades.OrderByDescending(grade => grade).Take(3); 
+0

那裏把這段代碼 – 2011-04-01 19:51:58

+0

您檢索DataList的數據源後,它會去(從無論你在那裏)。然後執行LINQ查詢並將其用作DataList的數據源。 – TheGeekYouNeed 2011-04-01 19:58:10