如何在wpf中重新刷新我的dataGrid [英] How can I refrech my dataGrid in wpf
本文介绍了如何在wpf中重新刷新我的dataGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我从datagrid中删除一行时,它也会在数据库中删除,但是我必须退出并返回到我删除它在矿时没有完成的内容,
解决方案
< blockquote>在数据绑定上尝试这些链接 -
WPF DataGrid实例 [ ^ ]
使用绑定 WPF DataGrid格式指南 [ ^ ]
Windows Presentation Foundation数据绑定:第1部分 [ ^ ]
我找到了解决方案但winforms不是wpf plzz任何人都可以在wpf中给出等价物:
dataGridView1.Rows.RemoveAt(dataGridView1.SelectedRows [i] .Index);
最终我找到了解决这个问题的方法:
((DataRowView)(dataGrid1.SelectedItem))。Row.Delete();
When i delete a row from datagrid it also deleted in database but i have to exit and return to what i deleted it does not done in the mine time,
解决方案
Try these links on databinding -
WPF DataGrid Practical Examples[^]
Guide to WPF DataGrid formatting using bindings[^]
Windows Presentation Foundation Data Binding: Part 1[^]
I found the solution but winforms not wpf plzz can anyone give the equivalent in wpf :
dataGridView1.Rows.RemoveAt(dataGridView1.SelectedRows[i].Index);
finaly I found solution to this problem :
((DataRowView)(dataGrid1.SelectedItem)).Row.Delete();
这篇关于如何在wpf中重新刷新我的dataGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文