首页 新闻 会员 周边

C# Dataset 集合 以整个表的形式绑定DataGridView 进度条怎么显示

0
悬赏园豆:10 [已解决问题] 解决于 2015-04-12 20:49

Datagridview 绑定以Dataset 做数据源   Datagridview的DataSourt用Dataset.Table[0] 绑定的  怎么让进度条真实显示进度。

NET技术员的主页 NET技术员 | 初学一级 | 园豆:8
提问于:2014-03-07 13:17
< >
分享
最佳答案
0

BackgroundWorker 类允许您在单独的专用线程上运行操作。耗时的操作(如下载和数据库事务)在长时间运行时可能会导致用户界面 (UI) 似乎处于停止响应状态。BackgroundWorker class provides a convenient solution.' xml:space="preserve">如果您需要能进行响应的用户界面,而且面临与这类操作相关的长时间延迟,则可以使用 BackgroundWorker 类方便地解决问题。

BackgroundWorker and listen for events that report the progress of your operation and signal when your operation is finished.' xml:space="preserve">若要在后台执行耗时的操作,请创建一个 BackgroundWorker,侦听那些报告操作进度并在操作完成时发出信号的事件。BackgroundWorker programmatically or you can drag it onto your form from the Components tab of the Toolbox.' xml:space="preserve">可以通过编程方式创建 BackgroundWorker,也可以将它从“工具箱”的“组件”选项卡中拖到窗体上。BackgroundWorker in the Windows Forms Designer, it will appear in the Component Tray, and its properties will be displayed in the Properties window.' xml:space="preserve">如果在 Windows 窗体设计器中创建 BackgroundWorker,则它会出现在组件栏中,而且它的属性会显示在“属性”窗口中。

http://msdn.microsoft.com/zh-cn/library/system.componentmodel.backgroundworker.aspx

自己看会才会有所理解

收获园豆:8
YoMe | 小虾三级 |园豆:545 | 2014-03-07 13:21
其他回答(3)
0

你先绑定一个空的 DataTable,然后一条记录一条记录的添加进去,这就是能显示真实进度了。

收获园豆:1
Launcher | 园豆:45045 (高人七级) | 2014-03-07 13:22
0

进度条应该是放在取数据部分,而不是数据显示部分吧。

收获园豆:1
xiashengwang | 园豆:209 (菜鸟二级) | 2014-06-24 17:58
0

已自己解决

NET技术员 | 园豆:8 (初学一级) | 2015-04-12 20:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册