【发布时间】:2011-10-02 21:26:21
【问题描述】:
所以我在 Silver 中创建了一个自动生成列的数据网格。我调用填充此数据网格的 WCF 服务。它显示除两列之外的所有列。有谁知道是什么原因造成的?
这是填充我的类的函数
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; }
}
【问题讨论】:
-
" 它显示除两列之外的所有列。"你的意思是,它只显示两列的数据?
-
@Ovais "all but" 实际上是相反的意思。除了这两列之外的所有内容。列是排名和亚马逊。
标签: c# silverlight wcf linq datagrid