如何从一个页面到另一个页面读取gridview值 [英] how to read gridview value from one page to another
本文介绍了如何从一个页面到另一个页面读取gridview值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将gridview值读取到另一个页面..请告诉我..
解决方案
表单是类似于其他任何类的。但是,它们具有从Form类继承的特定于窗口的行为。
这意味着您可以指定自己的构造函数并传递您想要的任何信息。例如,假设我们要在新表单中显示Person类。我们可以定义一个新的PersonForm来显示细节(这只是一个例子。你可以根据自己的需要调整它。)
public class PersonForm:Form
{
PersonForm(Person model)
{
InitializeComponents();
// 做点什么。
}
}
因此,当用户双击右侧单元格时,您将创建PersonForm的新实例并显示它。
how read gridview value one to another page..pls tell about that..
解决方案
Forms are classes like any other. However, they have window-specific behaviors they inherit from the Form class.
This means you can specify your own constructor and pass along any information you would like. For instance, let's say we have a Person class we want to show in a new Form. We could define a new PersonForm to show the details (this is just an example. You will be able to adapt it to your needs).
public class PersonForm : Form { PersonForm(Person model) { InitializeComponents(); //Do something. } }
So when a user double clicks the right cell, you create a new instance of the PersonForm and you show it.
这篇关于如何从一个页面到另一个页面读取gridview值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文