Datagrid WPF中未发生更新 [英] Update is not happening in Datagrid WPF

查看:82
本文介绍了Datagrid WPF中未发生更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码未发生更新.请帮助我解决该问题

Update is not happening with this code .please help me to resolve it

 public ProductsTableAdapter pta;
 public ProductsDS dataset;
         private void button1_Click(object sender, RoutedEventArgs e)
                {                       
                ProductsDS dataset = new ProductsDS();
                ProductsTableAdapter pta = new ProductsTableAdapter();                                                                                                                                  this.CustomerGrid.ItemsSource = dataset.Products;
                pta.Fill(dataset.Products);  
               }
private void button2_Click(object sender, RoutedEventArgs e)
        {                       
                pta.Update(dataset.Products);        

            
           
        }




在此先感谢




Thanks in advance

推荐答案

首先要检查的是正确定义的UpdateCommand .还可以在执行更新时收到任何错误消息吗?
First thing to check is the UpdateCommand defined properly. Also do you get any errors when Update is executed?


这篇关于Datagrid WPF中未发生更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆