如何基于tabcontrol.selectedindex.text过滤datagrid上显示的数据库值 [英] How to filter database values shown on datagrid based on tabcontrol.selectedindex.text

查看:53
本文介绍了如何基于tabcontrol.selectedindex.text过滤datagrid上显示的数据库值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如问题所说,我遇到了7 tab tabcontrol的问题。这可能会让你感到困惑。

i有7个选项卡,从Test1到Test7,只有当文本Test1的选项卡与数据库值匹配时,我才想显示引用Test1的数据所以...





任何帮助都会被贬值:)



我尝试了什么:



尝试使用int来识别公司的ID,然后在if语句中调用它们tabcontrol1.TabIndex = SomeVueue,somevalue从0到6,但不成功。

解决方案

  private   void  tabControl1_SelectedIndexChanged( object  sender,EventArgs e)
{
string selectedTabText = tabControl1.SelectedTab.Text;
// 适用于where子句

}


As the question says, i'm having troubles with a 7 tab tabcontrol. Which might get you confused.
i have 7 tabs, from Test1 to Test7, and i want to display the data refered to "Test1" only if the tab with the text "Test1" matches the database value and so on...


Any help would be apreciated :)

What I have tried:

Tryied to use ints to identify the id of the companies and then call them on a if statement where tabcontrol1.TabIndex= SomeValue which somevalue is from 0 to 6 , but unsucessfuly.

解决方案

private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
       {
          string selectedTabText= tabControl1.SelectedTab.Text;
//apply in where clause 

       }


这篇关于如何基于tabcontrol.selectedindex.text过滤datagrid上显示的数据库值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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