Datagrid单元格编辑事件

时间:2011-06-23 14:51:03

标签: silverlight linq list datagrid

所以我有一个数据网格,我通过LINQ查询填充:

public class dataservice
{
    [OperationContract]
    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,

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

        }
    }

    // Add more operations here and mark them with [OperationContract]
}
public class LightOrder
{
    public string SKU { get; set; }
    public string productname { get; set; }
    public string itemnumber { get; set; }
    public string asin { get; set; }
    //public Nullable<decimal> ourprice { get; set; }
    public string bbprice { get; set; }
    public string 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; }

}

我的问题是,如果我更改费用单元格并更改订单,我希望它告诉我总数,如何在不丢失数据网格或写入数据库的情况下执行此操作?

1 个答案:

答案 0 :(得分:0)

您可以创建临时变量。

double tempCost;
double tempOrder;
double tempTotal;