简体   繁体   English

c#winform datagridview单元格单击到TabControl页面

[英]c# winform datagridview cell click to TabControl Page

i want to implement a function that can 我想实现一个可以

click on the datagridview's cell/columns than will switch to Tab page 单击datagridview的单元格/列,然后将切换到“选项卡”页面

any idea on it ? 有什么想法吗?

like these picture 喜欢这些图片

pic one is the total result on Tab 1 and Tab2, when i click on cell/column 图一是当我单击单元格/列时在选项卡1和选项卡2上的总结果

switch to Tab1 or Tab2 to see the details 切换到Tab1或Tab2以查看详细信息

    private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        // check if you are clicking on needed column
        // and focus the tab
        if (e.ColumnIndex == 1) tabControl1.SelectedTab = tabPage2;
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM