更改选项卡时如何加载Datagrid? [英] How Do I Load A Datagrid When I Change Tabs?

查看:97
本文介绍了更改选项卡时如何加载Datagrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有3个标签,包含3个不同的数据网格;

- tabPage1,tabPage2和tabPage3;



这个数据网格:



- Dgv1,Dgv2和Dgv3。每个Dgv都分配给我的Windows窗体应用程序上的单个选项卡。



我面临的问题是我想在我加载数据网格的事实点击某个标签,例如:



当我点击tabPage2时,我希望它加载Dgv2和相应的参数化查询!



任何ideias?

For example, i have 3 tabs with 3 diferent datagrids;
- tabPage1, tabPage2 and tabPage3;

And this datagrids:

- Dgv1, Dgv2 and Dgv3. Each "Dgv" is assigned to a single tab on my Windows Forms application.

The problem I'm facing is the fact that i want to load the datagrid when i click on a certain tab, for example:

When i click tabPage2 i want it to load the Dgv2 and the corresponded Parameterized queries!

Any ideias?

推荐答案

处理TabControl.Selected事件(System.Windows.Forms) [ ^ ] - 它发生在页面被选中并即将变为可见。
Handle the TabControl.Selected Event (System.Windows.Forms)[^] - it occurs when the page is selected and about to become visible.


这篇关于更改选项卡时如何加载Datagrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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