2011-07-11 46 views
0

所以我在Silver中創建了一個自動生成列的數據網格。我稱之爲填充這個數據網格的WCF服務。它顯示除了兩列外的所有內容。有沒有人知道這是什麼原因?Silverlight Datagrid沒有正確顯示數據

這裏是爲界,

public List<LightOrder> GetOrder(string code) 
    { 
     // Add your operation implementation here 
     using (amazonproscoutEntities context = new amazonproscoutEntities()) 
     { 
      return (from c in context.AmazonSKUs 
        where c.MerchantSKU.StartsWith(code) 
        select new LightOrder() 
        { 
         SKU = c.MerchantSKU, 
         productname = c.ItemName, 
         asin = c.ASIN, 
         //ourprice = c.OurPrice, 
         bbprice = c.Price, 
         quantity = c.TotalQty, 
         rank = c.Rank, 
         amazon = c.Amazon, 
         afner = c.AFNer 
         //w1 = c.w1 

        } 
        ).Take<LightOrder>(500).ToList<LightOrder>(); 

     } 
    } 

這是充盈我的課的功能綁定類的數據網格:

public class LightOrder 
{ 
    public string SKU { get; set; } 
    public string productname { get; set; } 
    public string itemnumber { get; set; } 
    public string asin { get; set; } 
    public string amazon { get; set; } 
    public decimal ourprice { get; set; } 
    public string bbprice { get; set; } 
    public int w1 { get; set; } 
    public string w2 { get; set; } 
    public string w3 { get; set; } 
    public string w4 { get; set; } 
    public int quantity { get; set; } 
    public string pendingorder { get; set; } 
    public string afner { get; set; } 
    public string order { get; set; } 
    public string total { get; set; } 
    public string profit { get; set; } 
    public string percent { get; set; } 
    public string rank { get; set; } 

} 
+0

」它只顯示兩列。「這是什麼意思,它只顯示兩列的數據? –

+0

@Ovais「all but」實際上意味着相反。除了這兩列以外的所有內容列是排名和亞馬遜。 –

回答

0

事實證明,這是有問題的類。它似乎忽視了這些領域。 「

0

則會被標註爲這2列的[ DataMember]屬性?

如果您標記了它,但它們仍未出現,那麼服務引用可能沒有正確生成?

+0

我對你在問什麼感到困惑。 –