在网格视图中重新加载数据. [英] Reload Data's in grid view.

查看:63
本文介绍了在网格视图中重新加载数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我在网格中添加了一些项目.

Hi all,
I am adding some items in the grid.

by using  this way,
 1. Created a datatable
 2. Added Row in the Table
 3. Binded the datatable as Gird's Source



例如,网格有4行.

不幸的是,系统电源故障.我想在重新打开应用程序时重新加载那4行.

如果最终用户故意用网格中的行终止应用程序,则当他重新打开网格时应重新加载相同的数据.



该怎么做?

问候,
Pal



For example grid has 4 rows.

unfortunately system power fails. I want to reload that 4 rows when the application is reopened.

if end user purposely terminates the application with rows in grid, when he reopens grid should reload the same data.



how to do this?

regards,
Pal

推荐答案

嗨 1.使用数据集保留数据表.
2.使用DataSet.WriteXml(stringFileName)将数据保存为XML格式.
3.使用DataSet.ReadXml(stringFileName)从保存的XML文件中加载数据.

示例 [
Hi 1. Use DataSet to keep the DataTable.
2. Use DataSet.WriteXml(stringFileName) to save the data in XML format.
3. Use DataSet.ReadXml(stringFileName) to load the data from saved XML file.

Examples[^]

Have a nice day
Roman


这篇关于在网格视图中重新加载数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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