[英]Silverlight Datagrid not properly display data
所以我在 Silver 中創建了一個自動生成列的數據網格。 我調用了填充此數據網格的 WCF 服務。 它顯示除兩列之外的所有列。 有誰知道是什么原因造成的?
這是充滿我的 class 的 function
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>();
}
}
這是綁定數據網格的 class:
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; }
}
這 2 列是否由 [DataMember] 屬性標記?
如果您標記了它,但它們仍然沒有出現,可能是服務引用沒有正確生成?
事實證明,出現問題的是 class。 它似乎忽略了這些領域。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.