在xml更新上更新datagridview [英] update datagridview on xml update

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

问题描述



我正在使用Windows应用程序(VB.Net).

我有一个带有XML数据源的datagridview控件.

对XML文件进行任何更新/更改时,我需要更新datagridview行.


感谢

Hi,

I am using windows application (VB.Net).

I have a datagridview control with XML data source.

I need to update my datagridview rows when any update/change made to XML file.


Thanks

推荐答案

好吧,您怎么知道XML已更改?它在哪里 ?如果已更改,则可以重新绑定到它.如果它是硬盘驱动器上的文件,则可以在文件更改时使用文件观察器获取报告,然后重新加载.

http://msdn.microsoft.com/en-us/library/system.io. filesystemwatcher.aspx [ ^ ]
Well, how do you know the XML was changed ? Where is it ? If it''s changed, then you can rebind to it. If it''s a file on the hard drive, you can use a file watcher to get a report when the file is changed, and reload it.

http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx[^]


是的.戴夫,您是对的,我们需要重新整理xml文件,
做一件事,在记事本中打开该xml文件,并根据需要进行更改,然后将其保存为相同的文件名(不要忘记再次将扩展名.xml放在同一驱动器中),然后该系统将替换该文件,然后在运行后单击是".您的应用程序,它将起作用.

欢呼..
Prafulla
Yes. Dave you are right we need to relod the xml file,
Do one thing open that xml file in notepad and make changes whatever you want and save it as same file name(Dont forget to put the extension .xml once again) in same drive after that system will aking for replacing the file click yes after run your application, it will work.

cheers..
Prafulla


这篇关于在xml更新上更新datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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