如何在不使用数据绑定的情况下从列表填充WPF DataGrid? [英] How to populate a WPF DataGrid from a List without using Data Binding?

查看:275
本文介绍了如何在不使用数据绑定的情况下从列表填充WPF DataGrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道如何在不使用数据绑定和在DataGrid中手动定义列的情况下,用对象列表填充WPF DataGrid.

另外,如何在不使用数据绑定的情况下从MySQL或SQL数据库填充DataGrid?有没有一种方法可以单击DataGrid行并删除该行,并使DataGrid刷新并排除已删除的行,而不必重新加载WPF窗口.

在此先感谢您的帮助.

Hi,

I would like to know how to populate a WPF DataGrid with a list of objects without using data binding and manually defining columns in DataGrid.

Also how can you populating a DataGrid from a MySQL or SQL database without using data binding? Is there a way to click on a DataGrid row and delete that row and have the DataGrid refresh and exclude deleted row without having to reload WPF window.

Thanks in advance for any help.

推荐答案

关于WPF的AFAIK,常规Datagrid绑定(asp.net)和WPF Datagrid绑定在您执行操作时没有太大区别它在服务器端.因此,我希望此链接对您有用.
使用DataGrid控件绑定ArrayList [
AFAIK about WPF, there is not much difference in normal Datagrid binding (asp.net) and WPF Datagrid binding when you are doing it on server side. So I hope this link will be useful to you.
Binding an ArrayList with DataGrid Control[^]


Anurag


这篇关于如何在不使用数据绑定的情况下从列表填充WPF DataGrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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