如何从Anoher表单刷新Gridview [英] How Do I Refresh Gridview From Anoher Form

查看:74
本文介绍了如何从Anoher表单刷新Gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。我从数据库中删除记录并以第一种形式显示在网格中,然后调用另一个表单

2.我将第一个表单的实例传递给第二个表单。

3.第二个更改后的表单我返回第一个表单。

但此时似乎不会影响网格的变化

我看到在逐步调试时它的工作完美然后是什么导致我直接运行fomr但没有网格刷新或此处没有发生任何事情。

1. I made records deletions from db and shown in grid in 1st form and then call another form
2. I pass instance of 1st form to second form.
3. In second form after changes I returns to first Form.
but at this time it seems that changes not affecting grid
I saw that when in step by step debug it works perfect then what causes when i Run fomr directly but no grid refresh or nothing is happening over here.

推荐答案

我自己解决了我的问题。

什么我做的就是这个我只是从第二页调用构造函数。在这个构造函数中我调用了网格方法。

例如dbmanager是第一个表单而dbprop是第二个表单。

来自First当我打电话给第二个表格时表格

dbprop dbpr = new dbprop(this);



现在在第二页dbprop

dbmanager obj; //声明



在构造函数中我将dbmanager的实例分配给obj

然后在dbprop表单w上母鸡叫dbamanager表格

obj = new dbmanager(this)

/ * Imp不添加obj.show这将创建新实例* /

在dbmanager的构造函数中,我调用bindgrid方法
I have solved my problem myself.
What I have done is this I simply calls constructor from 2nd page .In this constructor i call grids method.
e.g dbmanager is first form and dbprop is second form.
From First form when i call 2nd form
dbprop dbpr=new dbprop(this);

Now in second page dbprop
dbmanager obj;//declare

in constructor i assign instance of dbmanager to obj
then on dbprop form when calling dbamanager form
obj=new dbmanager(this)
/*Imp dont add obj.show this will create new instance*/
in constructor of dbmanager i call bindgrid method


这篇关于如何从Anoher表单刷新Gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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